From 6817e9274da4417612c28c844a47e13304c40e92 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Jul 2026 16:03:18 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...ABExperimentServiceCreateABExperiment.g.cs | 555 + ...ABExperimentServiceDeleteABExperiment.g.cs | 519 + ...nt.ABExperimentServiceGetABExperiment.g.cs | 503 + ....ABExperimentServiceListABExperiments.g.cs | 520 + ...ABExperimentServiceUpdateABExperiment.g.cs | 594 + .../Together.ABExperimentServiceClient.g.cs | 175 + .../Together.AccountClient.Whoami.g.cs | 520 + .../Generated/Together.AccountClient.g.cs | 284 + .../Generated/Together.AllOf.2.Json.g.cs | 49 + .../Generated/Together.AnyOf.2.Json.g.cs | 49 + .../Together.AudioClient.AudioSpeech.g.cs | 42 +- ...ether.AudioClient.AudioTranscriptions.g.cs | 129 +- ...ogether.AudioClient.AudioTranslations.g.cs | 129 +- ...her.AudioClient.RealtimeTranscription.g.cs | 58 +- .../Together.AudioClient.RealtimeTts.g.cs | 54 +- .../Generated/Together.AudioClient.g.cs | 144 +- .../Together.BatchesClient.CreateBatches.g.cs | 101 +- ...BatchesClient.CreateBatchesByIdCancel.g.cs | 116 +- .../Together.BatchesClient.GetBatches.g.cs | 71 +- ...Together.BatchesClient.GetBatchesById.g.cs | 116 +- .../Generated/Together.BatchesClient.g.cs | 144 +- .../Together.ChatClient.ChatCompletions.g.cs | 145 +- ...er.ChatClient.ChatCompletionsAsStream.g.cs | 56 +- .../Generated/Together.ChatClient.g.cs | 144 +- ...er.CodeInterpreterClient.SessionsList.g.cs | 41 +- ...ther.CodeInterpreterClient.TciExecute.g.cs | 41 +- .../Together.CodeInterpreterClient.g.cs | 144 +- ...Together.CompletionClient.Completions.g.cs | 147 +- ....CompletionClient.CompletionsAsStream.g.cs | 58 +- .../Generated/Together.CompletionClient.g.cs | 144 +- ...eClient.ConfigServiceGetProjectConfig.g.cs | 490 + ...lient.ConfigServiceListProjectConfigs.g.cs | 535 + .../Together.ConfigServiceClient.g.cs | 175 + ...iceClient.DeploymentServiceAddAdapter.g.cs | 573 + ...ent.DeploymentServiceCreateDeployment.g.cs | 606 + ...ent.DeploymentServiceDeleteDeployment.g.cs | 519 + ...iceClient.DeploymentServiceGetAdapter.g.cs | 516 + ...Client.DeploymentServiceGetDeployment.g.cs | 503 + ...eClient.DeploymentServiceListAdapters.g.cs | 533 + ...ient.DeploymentServiceListDeployments.g.cs | 548 + ...Client.DeploymentServiceRemoveAdapter.g.cs | 532 + ...Client.DeploymentServiceUpdateAdapter.g.cs | 586 + ...ent.DeploymentServiceUpdateDeployment.g.cs | 594 + .../Together.DeploymentServiceClient.g.cs | 175 + ...r.DeploymentsClient.CreateDeployments.g.cs | 71 +- ...ploymentsClient.DeleteDeploymentsById.g.cs | 71 +- ...DeploymentsClient.EditDeploymentsById.g.cs | 86 +- ...ther.DeploymentsClient.GetDeployments.g.cs | 56 +- ....DeploymentsClient.GetDeploymentsById.g.cs | 71 +- ...loymentsClient.GetDeploymentsByIdLogs.g.cs | 71 +- .../Generated/Together.DeploymentsClient.g.cs | 144 +- ...lient.GetDeploymentsStorageByFilename.g.cs | 101 +- ...nt.GetDeploymentsStorageByFilenameUrl.g.cs | 86 +- .../Together.DeploymentsStorageClient.g.cs | 144 +- ...lient.CreateDeploymentsStorageVolumes.g.cs | 71 +- ...esClient.GetDeploymentsStorageVolumes.g.cs | 56 +- .../Together.DeploymentsVolumesClient.g.cs | 144 +- .../Together.EmbeddingsClient.Embeddings.g.cs | 131 +- .../Generated/Together.EmbeddingsClient.g.cs | 144 +- ...eClient.EndpointServiceCreateEndpoint.g.cs | 533 + ...eClient.EndpointServiceDeleteEndpoint.g.cs | 506 + ...viceClient.EndpointServiceGetEndpoint.g.cs | 490 + ...t.EndpointServiceGetEndpointAnalytics.g.cs | 562 + ...ent.EndpointServiceListEndpointEvents.g.cs | 618 + ...ceClient.EndpointServiceListEndpoints.g.cs | 537 + ...pointServiceListOrganizationEndpoints.g.cs | 535 + ...nt.EndpointServiceListPublicEndpoints.g.cs | 522 + ...eClient.EndpointServiceUpdateEndpoint.g.cs | 582 + .../Together.EndpointServiceClient.g.cs | 175 + ...er.Endpoints2Client.AvailabilityZones.g.cs | 41 +- .../Generated/Together.Endpoints2Client.g.cs | 144 +- .../Together.EndpointsClient.AddAdapter.g.cs | 637 + ...gether.EndpointsClient.CreateEndpoint.g.cs | 71 +- ...gether.EndpointsClient.DeleteEndpoint.g.cs | 86 +- .../Together.EndpointsClient.GetEndpoint.g.cs | 86 +- ...Together.EndpointsClient.ListAdapters.g.cs | 498 + ...ogether.EndpointsClient.ListEndpoints.g.cs | 71 +- ...ogether.EndpointsClient.RemoveAdapter.g.cs | 625 + ...gether.EndpointsClient.UpdateEndpoint.g.cs | 86 +- .../Generated/Together.EndpointsClient.g.cs | 144 +- ....EvaluationClient.CreateEvaluationJob.g.cs | 71 +- ...EvaluationClient.GetAllEvaluationJobs.g.cs | 71 +- ...luationClient.GetEvaluationJobDetails.g.cs | 71 +- ...ient.GetEvaluationJobStatusAndResults.g.cs | 71 +- ...ogether.EvaluationClient.GetModelList.g.cs | 71 +- .../Generated/Together.EvaluationClient.g.cs | 144 +- .../Generated/Together.Exceptions.g.cs | 134 + ...ogether.FilesClient.CreateFilesUpload.g.cs | 412 +- .../Together.FilesClient.DeleteFilesById.g.cs | 41 +- .../Together.FilesClient.GetFiles.g.cs | 41 +- .../Together.FilesClient.GetFilesById.g.cs | 41 +- ...ether.FilesClient.GetFilesByIdContent.g.cs | 86 +- .../Generated/Together.FilesClient.g.cs | 144 +- ...ther.FineTuningClient.CreateFineTunes.g.cs | 84 +- ...uningClient.CreateFineTunesByIdCancel.g.cs | 67 +- ...ngClient.CreateFineTunesEstimatePrice.g.cs | 70 +- ...neTuningClient.CreateFineTunesPreview.g.cs | 722 + ....FineTuningClient.DeleteFineTunesById.g.cs | 71 +- ...ogether.FineTuningClient.GetFineTunes.g.cs | 41 +- ...her.FineTuningClient.GetFineTunesById.g.cs | 41 +- ...ingClient.GetFineTunesByIdCheckpoints.g.cs | 41 +- ...neTuningClient.GetFineTunesByIdEvents.g.cs | 41 +- ...eTuningClient.GetFineTunesByIdMetrics.g.cs | 104 +- ...TuningClient.GetFineTunesModelsLimits.g.cs | 56 +- ...ingClient.GetFineTunesModelsSupported.g.cs | 41 +- ....FineTuningClient.GetFinetuneDownload.g.cs | 114 +- .../Generated/Together.FineTuningClient.g.cs | 144 +- ...ServiceClient.GPUClusterServiceCreate.g.cs | 47 +- ...ServiceClient.GPUClusterServiceDelete.g.cs | 41 +- ...terServiceClient.GPUClusterServiceGet.g.cs | 41 +- ...erServiceClient.GPUClusterServiceList.g.cs | 43 +- ...ServiceClient.GPUClusterServiceUpdate.g.cs | 46 +- .../Together.GPUClusterServiceClient.g.cs | 144 +- .../Together.HardwareClient.ListHardware.g.cs | 71 +- .../Generated/Together.HardwareClient.g.cs | 144 +- ...ckServiceListPassiveHealthCheckAlerts.g.cs | 534 + .../Together.HealthCheckServiceClient.g.cs | 284 + ...ABExperimentServiceCreateABExperiment.g.cs | 80 + ...ABExperimentServiceDeleteABExperiment.g.cs | 60 + ...nt.ABExperimentServiceGetABExperiment.g.cs | 52 + ....ABExperimentServiceListABExperiments.g.cs | 60 + ...ABExperimentServiceUpdateABExperiment.g.cs | 104 + .../Together.IABExperimentServiceClient.g.cs | 48 + .../Together.IAccountClient.Whoami.g.cs | 42 + .../Generated/Together.IAccountClient.g.cs | 69 + ...ther.IAudioClient.AudioTranscriptions.g.cs | 6 +- ...gether.IAudioClient.AudioTranslations.g.cs | 6 +- ...er.IAudioClient.RealtimeTranscription.g.cs | 4 +- .../Generated/Together.IAudioClient.g.cs | 21 + .../Generated/Together.IBatchesClient.g.cs | 21 + .../Together.IChatClient.ChatCompletions.g.cs | 14 +- ...r.IChatClient.ChatCompletionsAsStream.g.cs | 14 +- .../Generated/Together.IChatClient.g.cs | 21 + .../Together.ICodeInterpreterClient.g.cs | 21 + ...ogether.ICompletionClient.Completions.g.cs | 16 +- ...ICompletionClient.CompletionsAsStream.g.cs | 16 +- .../Generated/Together.ICompletionClient.g.cs | 21 + ...eClient.ConfigServiceGetProjectConfig.g.cs | 44 + ...lient.ConfigServiceListProjectConfigs.g.cs | 68 + .../Together.IConfigServiceClient.g.cs | 48 + ...iceClient.DeploymentServiceAddAdapter.g.cs | 92 + ...ent.DeploymentServiceCreateDeployment.g.cs | 116 + ...ent.DeploymentServiceDeleteDeployment.g.cs | 60 + ...iceClient.DeploymentServiceGetAdapter.g.cs | 60 + ...Client.DeploymentServiceGetDeployment.g.cs | 52 + ...eClient.DeploymentServiceListAdapters.g.cs | 68 + ...ient.DeploymentServiceListDeployments.g.cs | 76 + ...Client.DeploymentServiceRemoveAdapter.g.cs | 68 + ...Client.DeploymentServiceUpdateAdapter.g.cs | 100 + ...ent.DeploymentServiceUpdateDeployment.g.cs | 104 + .../Together.IDeploymentServiceClient.g.cs | 48 + .../Together.IDeploymentsClient.g.cs | 21 + .../Together.IDeploymentsStorageClient.g.cs | 21 + .../Together.IDeploymentsVolumesClient.g.cs | 21 + .../Generated/Together.IEmbeddingsClient.g.cs | 21 + ...eClient.EndpointServiceCreateEndpoint.g.cs | 65 + ...eClient.EndpointServiceDeleteEndpoint.g.cs | 52 + ...viceClient.EndpointServiceGetEndpoint.g.cs | 44 + ...t.EndpointServiceGetEndpointAnalytics.g.cs | 84 + ...ent.EndpointServiceListEndpointEvents.g.cs | 116 + ...ceClient.EndpointServiceListEndpoints.g.cs | 70 + ...pointServiceListOrganizationEndpoints.g.cs | 68 + ...nt.EndpointServiceListPublicEndpoints.g.cs | 60 + ...eClient.EndpointServiceUpdateEndpoint.g.cs | 97 + .../Together.IEndpointServiceClient.g.cs | 48 + .../Generated/Together.IEndpoints2Client.g.cs | 21 + .../Together.IEndpointsClient.AddAdapter.g.cs | 91 + ...ogether.IEndpointsClient.ListAdapters.g.cs | 52 + ...gether.IEndpointsClient.RemoveAdapter.g.cs | 79 + .../Generated/Together.IEndpointsClient.g.cs | 21 + .../Generated/Together.IEvaluationClient.g.cs | 21 + .../Generated/Together.IFilesClient.g.cs | 21 + ...her.IFineTuningClient.CreateFineTunes.g.cs | 39 +- ...ngClient.CreateFineTunesEstimatePrice.g.cs | 6 +- ...neTuningClient.CreateFineTunesPreview.g.cs | 67 + ...eTuningClient.GetFineTunesByIdMetrics.g.cs | 12 +- ...IFineTuningClient.GetFinetuneDownload.g.cs | 6 +- .../Generated/Together.IFineTuningClient.g.cs | 21 + ...ServiceClient.GPUClusterServiceCreate.g.cs | 5 - ...ServiceClient.GPUClusterServiceUpdate.g.cs | 4 + .../Together.IGPUClusterServiceClient.g.cs | 21 + .../Generated/Together.IHardwareClient.g.cs | 21 + ...ckServiceListPassiveHealthCheckAlerts.g.cs | 86 + .../Together.IHealthCheckServiceClient.g.cs | 69 + .../Generated/Together.IImagesClient.g.cs | 21 + ...ent.InstanceClusterAddOnServiceCreate.g.cs | 12 +- ...ent.InstanceClusterAddOnServiceUpdate.g.cs | 4 +- ...er.IInstanceClusterAddOnServiceClient.g.cs | 21 + ...ceTypeServiceGetInferenceInstanceType.g.cs | 36 + ...TypeServiceListInferenceInstanceTypes.g.cs | 28 + .../Together.IInstanceTypeServiceClient.g.cs | 48 + .../Generated/Together.IJobsClient.g.cs | 21 + .../Generated/Together.IModelsClient.g.cs | 21 + ...mentProfileServiceGetPlacementProfile.g.cs | 44 + ...ntProfileServiceListPlacementProfiles.g.cs | 52 + ...gether.IPlacementProfileServiceClient.g.cs | 48 + .../Together.IQueueClient.ClearQueue.g.cs | 48 + .../Together.IQueueClient.SubmitQueueJob.g.cs | 9 +- .../Generated/Together.IQueueClient.g.cs | 21 + .../Together.IRegionServiceClient.g.cs | 21 + ....RemediationServiceApproveRemediation.g.cs | 15 +- ...t.RemediationServiceCreateRemediation.g.cs | 5 +- ...nt.RemediationServiceListRemediations.g.cs | 46 +- .../Together.IRemediationServiceClient.g.cs | 21 + .../Generated/Together.IRerankClient.g.cs | 21 + ...gether.IRlClient.CreateModelResources.g.cs | 63 + ...ether.IRlClient.CustomForwardBackward.g.cs | 64 + ....IRlClient.EstimateModelResourcesCost.g.cs | 63 + .../Generated/Together.IRlClient.Forward.g.cs | 60 + ...ent.GetCustomForwardBackwardOperation.g.cs | 44 + ...ogether.IRlClient.GetForwardOperation.g.cs | 44 + .../Together.IRlClient.GetModelResources.g.cs | 36 + ...Together.IRlClient.ListModelResources.g.cs | 62 + ...ogether.IRlClient.ListSupportedModels.g.cs | 28 + ...gether.IRlClient.ListTrainingSessions.g.cs | 26 +- .../Together.IRlClient.OptimStep.g.cs | 21 +- .../Generated/Together.IRlClient.Sample.g.cs | 2 +- ...gether.IRlClient.StartTrainingSession.g.cs | 20 +- ...Together.IRlClient.StopModelResources.g.cs | 46 + .../Generated/Together.IRlClient.g.cs | 21 + ...iceClient.RolloutServiceCancelRollout.g.cs | 92 + ...iceClient.RolloutServiceCreateRollout.g.cs | 108 + ...iceClient.RolloutServiceDeleteRollout.g.cs | 60 + ...erviceClient.RolloutServiceGetRollout.g.cs | 52 + ...viceClient.RolloutServiceListRollouts.g.cs | 68 + ...viceClient.RolloutServicePauseRollout.g.cs | 88 + ...ceClient.RolloutServicePromoteRollout.g.cs | 84 + ...iceClient.RolloutServiceResumeRollout.g.cs | 84 + ...viceClient.RolloutServiceStartRollout.g.cs | 52 + .../Together.IRolloutServiceClient.g.cs | 48 + .../Generated/Together.ISecretsClient.g.cs | 21 + ...perimentServiceCreateShadowExperiment.g.cs | 80 + ...t.ShadowExperimentServiceCreateTarget.g.cs | 92 + ...perimentServiceDeleteShadowExperiment.g.cs | 60 + ...t.ShadowExperimentServiceDeleteTarget.g.cs | 68 + ...wExperimentServiceGetShadowExperiment.g.cs | 52 + ...ient.ShadowExperimentServiceGetTarget.g.cs | 60 + ...xperimentServiceListShadowExperiments.g.cs | 68 + ...nt.ShadowExperimentServiceListTargets.g.cs | 68 + ...perimentServiceUpdateShadowExperiment.g.cs | 104 + ...t.ShadowExperimentServiceUpdateTarget.g.cs | 120 + ...gether.IShadowExperimentServiceClient.g.cs | 48 + ...rviceClient.SharedVolumeServiceCreate.g.cs | 4 + .../Together.ISharedVolumeServiceClient.g.cs | 21 + ...pportedModelsServiceGetSupportedModel.g.cs | 36 + ...ortedModelsServiceListSupportedModels.g.cs | 68 + ...ogether.ISupportedModelsServiceClient.g.cs | 48 + .../Generated/Together.ITogetherClient.g.cs | 60 + .../Generated/Together.IVoicesClient.g.cs | 21 + ...erviceClient.VolumeServiceCreateModel.g.cs | 72 + ....VolumeServiceCreateRemoteModelUpload.g.cs | 68 + ...erviceClient.VolumeServiceDeleteModel.g.cs | 44 + ...meServiceClient.VolumeServiceGetModel.g.cs | 44 + ...ent.VolumeServiceGetRemoteModelUpload.g.cs | 44 + ...t.VolumeServiceGetRevisionByModelType.g.cs | 52 + ...iceClient.VolumeServiceListModelFiles.g.cs | 52 + ...lient.VolumeServiceListModelRevisions.g.cs | 44 + ...ServiceClient.VolumeServiceListModels.g.cs | 68 + ...t.VolumeServiceListOrganizationModels.g.cs | 52 + ...umeServiceListRemoteModelUploadEvents.g.cs | 60 + ...t.VolumeServiceListRemoteModelUploads.g.cs | 52 + ...erviceClient.VolumeServiceUpdateModel.g.cs | 93 + .../Together.IVolumeServiceClient.g.cs | 48 + .../Generated/Together.IVolumesClient.g.cs | 21 + ....ImagesClient.CreateImagesGenerations.g.cs | 41 +- .../Generated/Together.ImagesClient.g.cs | 144 +- ...ent.InstanceClusterAddOnServiceCreate.g.cs | 53 +- ...ent.InstanceClusterAddOnServiceDelete.g.cs | 41 +- ...Client.InstanceClusterAddOnServiceGet.g.cs | 41 +- ...lient.InstanceClusterAddOnServiceList.g.cs | 41 +- ...ent.InstanceClusterAddOnServiceUpdate.g.cs | 45 +- ...her.InstanceClusterAddOnServiceClient.g.cs | 144 +- ...ceTypeServiceGetInferenceInstanceType.g.cs | 477 + ...TypeServiceListInferenceInstanceTypes.g.cs | 464 + .../Together.InstanceTypeServiceClient.g.cs | 175 + .../Generated/Together.JobsClient.GetJob.g.cs | 41 +- .../Together.JobsClient.ListJobs.g.cs | 41 +- .../Generated/Together.JobsClient.g.cs | 144 +- ...verters.ApproveRemediationRequestMode.g.cs | 53 + ...ApproveRemediationRequestModeNullable.g.cs | 60 + ...riceResponseVariant2UnavailableReason.g.cs | 53 + ...onseVariant2UnavailableReasonNullable.g.cs | 60 + ...onConverters.DeABExperimentMemberRole.g.cs | 53 + ...ters.DeABExperimentMemberRoleNullable.g.cs | 60 + ....JsonConverters.DeAutoscalingResponse.g.cs | 145 + ...ers.DeCancelRolloutRequestDisposition.g.cs | 53 + ...ncelRolloutRequestDispositionNullable.g.cs | 60 + ...ters.DeCertificationCertificationType.g.cs | 53 + ...ertificationCertificationTypeNullable.g.cs | 60 + ....JsonConverters.DeCertificationTarget.g.cs | 53 + ...verters.DeCertificationTargetNullable.g.cs | 60 + ...onverters.DeConfigDeploymentFramework.g.cs | 53 + ...s.DeConfigDeploymentFrameworkNullable.g.cs | 60 + ...her.JsonConverters.DeConfigEngineType.g.cs | 53 + ...Converters.DeConfigEngineTypeNullable.g.cs | 60 + ...ers.DeCreateEndpointRequestVisibility.g.cs | 53 + ...eateEndpointRequestVisibilityNullable.g.cs | 60 + ...s.DeCreateRolloutRequestSourceCleanup.g.cs | 53 + ...teRolloutRequestSourceCleanupNullable.g.cs | 60 + ...erters.DeDeploymentAdapterStatusState.g.cs | 53 + ...eDeploymentAdapterStatusStateNullable.g.cs | 60 + ...sonConverters.DeDeploymentStatusState.g.cs | 53 + ...rters.DeDeploymentStatusStateNullable.g.cs | 60 + ...onConverters.DeDeploymentSummaryState.g.cs | 53 + ...ters.DeDeploymentSummaryStateNullable.g.cs | 60 + ...erters.DeDeploymentSummaryTrafficMode.g.cs | 53 + ...eDeploymentSummaryTrafficModeNullable.g.cs | 60 + ...sonConverters.DeDeploymentTrafficMode.g.cs | 53 + ...rters.DeDeploymentTrafficModeNullable.g.cs | 60 + ...JsonConverters.DeEndpointEndpointType.g.cs | 53 + ...erters.DeEndpointEndpointTypeNullable.g.cs | 60 + ...r.JsonConverters.DeEndpointEventLevel.g.cs | 53 + ...nverters.DeEndpointEventLevelNullable.g.cs | 60 + ...nConverters.DeEndpointEventSourceKind.g.cs | 53 + ...ers.DeEndpointEventSourceKindNullable.g.cs | 60 + ...Converters.DeEndpointUpdateVisibility.g.cs | 53 + ...rs.DeEndpointUpdateVisibilityNullable.g.cs | 60 + ...r.JsonConverters.DeEndpointVisibility.g.cs | 53 + ...nverters.DeEndpointVisibilityNullable.g.cs | 60 + ...her.JsonConverters.DeHeadroomRelation.g.cs | 53 + ...Converters.DeHeadroomRelationNullable.g.cs | 60 + ...onverters.DeInlinePlacementConstraint.g.cs | 53 + ...s.DeInlinePlacementConstraintNullable.g.cs | 60 + ...sionsResponseRevisionValidationStatus.g.cs | 53 + ...ponseRevisionValidationStatusNullable.g.cs | 60 + ...er.JsonConverters.DeMetricResultCheck.g.cs | 53 + ...onverters.DeMetricResultCheckNullable.g.cs | 60 + ...sonConverters.DeMetricResultDirection.g.cs | 53 + ...rters.DeMetricResultDirectionNullable.g.cs | 60 + ...JsonConverters.DeMetricResultOperator.g.cs | 53 + ...erters.DeMetricResultOperatorNullable.g.cs | 60 + ...her.JsonConverters.DeMetricResultStat.g.cs | 53 + ...Converters.DeMetricResultStatNullable.g.cs | 60 + ....JsonConverters.DeMetricResultVerdict.g.cs | 53 + ...verters.DeMetricResultVerdictNullable.g.cs | 60 + ...ether.JsonConverters.DeMetricRuleStat.g.cs | 53 + ...onConverters.DeMetricRuleStatNullable.g.cs | 60 + ...ther.JsonConverters.DeModelVisibility.g.cs | 53 + ...nConverters.DeModelVisibilityNullable.g.cs | 60 + ...ers.DeModelWeightsDraftSpeculatorType.g.cs | 53 + ...delWeightsDraftSpeculatorTypeNullable.g.cs | 60 + ...ers.DeModelWeightsSpeculatorMechanism.g.cs | 53 + ...delWeightsSpeculatorMechanismNullable.g.cs | 60 + ...her.JsonConverters.DeModelWeightsType.g.cs | 53 + ...Converters.DeModelWeightsTypeNullable.g.cs | 60 + .../Together.JsonConverters.DePlacement.g.cs | 141 + ...Converters.DeRegressionCheckDirection.g.cs | 53 + ...rs.DeRegressionCheckDirectionNullable.g.cs | 60 + ...onConverters.DeRemoteUploadEventLevel.g.cs | 53 + ...ters.DeRemoteUploadEventLevelNullable.g.cs | 60 + ...r.JsonConverters.DeRemoteUploadStatus.g.cs | 53 + ...nverters.DeRemoteUploadStatusNullable.g.cs | 60 + ...Converters.DeRolloutConditionCategory.g.cs | 53 + ...rs.DeRolloutConditionCategoryNullable.g.cs | 60 + ...gether.JsonConverters.DeRolloutState.g.cs} | 14 +- ...sonConverters.DeRolloutStateNullable.g.cs} | 14 +- ...onConverters.DeRolloutStepStatusState.g.cs | 53 + ...ters.DeRolloutStepStatusStateNullable.g.cs | 60 + ...ther.JsonConverters.DeRolloutStrategy.g.cs | 53 + ...nConverters.DeRolloutStrategyNullable.g.cs | 60 + ...er.JsonConverters.DeScalingMetricType.g.cs | 53 + ...onverters.DeScalingMetricTypeNullable.g.cs | 60 + ...Converters.DeShadowExperimentSampling.g.cs | 229 + ...rs.DeShadowExperimentSamplingResponse.g.cs | 229 + ...sonConverters.DeShadowExperimentState.g.cs | 53 + ...rters.DeShadowExperimentStateNullable.g.cs | 60 + ...onverters.DeSupportedModelCapabilitie.g.cs | 53 + ...s.DeSupportedModelCapabilitieNullable.g.cs | 60 + ...sonConverters.DeSupportedModelFeature.g.cs | 53 + ...rters.DeSupportedModelFeatureNullable.g.cs | 60 + ...erters.DeSupportedModelInputModalitie.g.cs | 53 + ...eSupportedModelInputModalitieNullable.g.cs | 60 + ...rters.DeSupportedModelOutputModalitie.g.cs | 53 + ...SupportedModelOutputModalitieNullable.g.cs | 60 + ...sonConverters.DeSupportedModelProduct.g.cs | 53 + ...rters.DeSupportedModelProductNullable.g.cs | 60 + ...JsonConverters.DeSupportedModelStatus.g.cs | 53 + ...erters.DeSupportedModelStatusNullable.g.cs | 60 + ...onConverters.DeThresholdCheckOperator.g.cs | 53 + ...ters.DeThresholdCheckOperatorNullable.g.cs | 60 + ...erters.DeUpdateModelRequestVisibility.g.cs | 53 + ...eUpdateModelRequestVisibilityNullable.g.cs | 60 + ...ointServiceListEndpointEventsMinLevel.g.cs | 53 + ...iceListEndpointEventsMinLevelNullable.g.cs | 60 + ...ntServiceListEndpointEventsSourceKind.g.cs | 53 + ...eListEndpointEventsSourceKindNullable.g.cs | 60 + ...r.JsonConverters.FileProcessingStatus.g.cs | 53 + ...nverters.FileProcessingStatusNullable.g.cs | 60 + ...verters.FileValidationReportErrorType.g.cs | 53 + ...FileValidationReportErrorTypeNullable.g.cs | 60 + ...nverters.FineTuneCheckpointCheckpoint.g.cs | 53 + ....FineTuneCheckpointCheckpointNullable.g.cs | 60 + ....FineTunePreviewRequestTrainingMethod.g.cs | 53 + ...ePreviewRequestTrainingMethodNullable.g.cs | 60 + ....FineTunePreviewResponseDatasetFormat.g.cs | 53 + ...ePreviewResponseDatasetFormatNullable.g.cs | 60 + ...veHealthCheckAlertsSeverityFilterItem.g.cs | 53 + ...CheckAlertsSeverityFilterItemNullable.g.cs | 60 + ...iceListPassiveHealthCheckAlertsStatus.g.cs | 53 + ...assiveHealthCheckAlertsStatusNullable.g.cs | 60 + ...sonConverters.ListModelResourcesStatu.g.cs | 53 + ...rters.ListModelResourcesStatuNullable.g.cs | 60 + ...nConverters.ListTrainingSessionsStatu.g.cs | 53 + ...ers.ListTrainingSessionsStatuNullable.g.cs | 60 + ...rters.PassiveHealthCheckAlertSeverity.g.cs | 53 + ...ssiveHealthCheckAlertSeverityNullable.g.cs | 60 + ...ationServiceListRemediationsModeItem.g.cs} | 14 +- ...viceListRemediationsModeItemNullable.g.cs} | 14 +- ...ionServiceListRemediationsTriggerItem.g.cs | 53 + ...ceListRemediationsTriggerItemNullable.g.cs | 60 + ...er.JsonConverters.RlGRPOLossRatioType.g.cs | 53 + ...onverters.RlGRPOLossRatioTypeNullable.g.cs | 60 + ...nConverters.RlModelResourcesErrorCode.g.cs | 53 + ...ers.RlModelResourcesErrorCodeNullable.g.cs | 60 + ...JsonConverters.RlModelResourcesStatus.g.cs | 53 + ...erters.RlModelResourcesStatusNullable.g.cs | 60 + ....JsonConverters.RlMuonScalingStrategy.g.cs | 53 + ...verters.RlMuonScalingStrategyNullable.g.cs | 60 + ...Converters.RlTrainingSessionErrorCode.g.cs | 53 + ...rs.RlTrainingSessionErrorCodeNullable.g.cs | 60 + ...ether.JsonConverters.RlWeightSyncType.g.cs | 53 + ...onConverters.RlWeightSyncTypeNullable.g.cs | 60 + ...ters.RolloutServiceListRolloutsFilter.g.cs | 53 + ...loutServiceListRolloutsFilterNullable.g.cs | 60 + ...elsServiceListSupportedModelsModality.g.cs | 53 + ...ceListSupportedModelsModalityNullable.g.cs | 60 + ...delsServiceListSupportedModelsProduct.g.cs | 53 + ...iceListSupportedModelsProductNullable.g.cs | 60 + ...ers.VolumeServiceListModelsVisibility.g.cs | 53 + ...meServiceListModelsVisibilityNullable.g.cs | 60 + .../Together.JsonSerializerContext.g.cs | 2883 +- .../Together.JsonSerializerContextTypes.g.cs | 2908 +- ...her.Models.AcceptanceTestsParams.Json.g.cs | 49 + ...Together.Models.AcceptanceTestsParams.g.cs | 13 +- ...ogether.Models.AddAdapterRequest.Json.g.cs | 141 + .../Together.Models.AddAdapterRequest.g.cs | 50 + ...gether.Models.AddAdapterResponse.Json.g.cs | 141 + .../Together.Models.AddAdapterResponse.g.cs | 44 + .../Together.Models.AddOnConfig.Json.g.cs | 49 + .../Together.Models.AddOnConfig.g.cs | 37 +- ...gether.Models.AddOnCreateRequest.Json.g.cs | 49 + .../Together.Models.AddOnCreateRequest.g.cs | 10 +- .../Together.Models.AddOnInfo.Json.g.cs | 49 + .../Generated/Together.Models.AddOnInfo.g.cs | 12 +- .../Together.Models.AddOnState.Json.g.cs | 49 + .../Generated/Together.Models.AddOnState.g.cs | 37 +- ...gether.Models.AddOnUpdateRequest.Json.g.cs | 49 + .../Together.Models.AddOnUpdateRequest.g.cs | 6 +- ...Models.ApproveRemediationRequest.Json.g.cs | 141 + ...ther.Models.ApproveRemediationRequest.g.cs | 68 + ....Models.ApproveRemediationRequestMode.g.cs | 74 + .../Together.Models.AudioRef.Json.g.cs | 49 + ...gether.Models.AudioSpeechRequest.Json.g.cs | 49 + ...ls.AudioSpeechRequestExtraParams.Json.g.cs | 49 + ...er.Models.AudioSpeechStreamChunk.Json.g.cs | 49 + ...els.AudioSpeechStreamChunkObject.Json.g.cs | 49 + ...er.Models.AudioSpeechStreamEvent.Json.g.cs | 49 + ...Models.AudioSpeechStreamResponse.Json.g.cs | 49 + ...s.AudioTranscriptionJsonResponse.Json.g.cs | 49 + ...Models.AudioTranscriptionRequest.Json.g.cs | 49 + ...ther.Models.AudioTranscriptionRequest.g.cs | 12 +- ...odels.AudioTranscriptionResponse.Json.g.cs | 49 + ...Models.AudioTranscriptionSegment.Json.g.cs | 49 + ...ther.Models.AudioTranscriptionSegment.g.cs | 14 +- ...AudioTranscriptionSpeakerSegment.Json.g.cs | 49 + ...dels.AudioTranscriptionSpeakerSegment.g.cs | 14 +- ...TranscriptionVerboseJsonResponse.Json.g.cs | 49 + ...AudioTranscriptionVerboseJsonResponse.g.cs | 4 +- ...er.Models.AudioTranscriptionWord.Json.g.cs | 49 + ...ogether.Models.AudioTranscriptionWord.g.cs | 14 +- ...els.AudioTranslationJsonResponse.Json.g.cs | 49 + ...r.Models.AudioTranslationRequest.Json.g.cs | 49 + ...gether.Models.AudioTranslationRequest.g.cs | 12 +- ....Models.AudioTranslationResponse.Json.g.cs | 49 + ...ioTranslationVerboseJsonResponse.Json.g.cs | 49 + ...s.AudioTranslationVerboseJsonResponse.g.cs | 4 +- .../Together.Models.Autoscaling.Json.g.cs | 49 + ...gether.Models.BatchErrorResponse.Json.g.cs | 49 + .../Together.Models.BatchJob.Json.g.cs | 49 + .../Generated/Together.Models.BatchJob.g.cs | 6 +- ...ether.Models.BatchJobWithWarning.Json.g.cs | 49 + ...tCompletionAssistantMessageParam.Json.g.cs | 49 + ...ssistantMessageParamFunctionCall.Json.g.cs | 49 + ...ther.Models.ChatCompletionChoice.Json.g.cs | 49 + ...Models.ChatCompletionChoiceDelta.Json.g.cs | 49 + ...ompletionChoiceDeltaFunctionCall.Json.g.cs | 49 + ...ls.ChatCompletionChoicesDataItem.Json.g.cs | 49 + ...ether.Models.ChatCompletionChunk.Json.g.cs | 49 + ...Models.ChatCompletionChunkChoice.Json.g.cs | 49 + ...s.ChatCompletionChunkChoiceDelta.Json.g.cs | 49 + ...tionChunkChoiceDeltaFunctionCall.Json.g.cs | 49 + ...Models.ChatCompletionChunkObject.Json.g.cs | 49 + ...ether.Models.ChatCompletionEvent.Json.g.cs | 49 + ...atCompletionFunctionMessageParam.Json.g.cs | 49 + ...her.Models.ChatCompletionMessage.Json.g.cs | 49 + ...hatCompletionMessageFunctionCall.Json.g.cs | 49 + ...odels.ChatCompletionMessageParam.Json.g.cs | 49 + ...her.Models.ChatCompletionRequest.Json.g.cs | 49 + ...Together.Models.ChatCompletionRequest.g.cs | 30 +- ...pletionRequestChatTemplateKwargs.Json.g.cs | 49 + ....ChatCompletionRequestCompliance.Json.g.cs | 49 + ...mpletionRequestFunctionCallEnum2.Json.g.cs | 49 + ...s.ChatCompletionRequestLogitBias.Json.g.cs | 49 + ...Models.ChatCompletionRequestLogitBias.g.cs | 2 +- ...s.ChatCompletionRequestReasoning.Json.g.cs | 49 + ...questResponseFormatDiscriminator.Json.g.cs | 49 + ...er.Models.ChatCompletionResponse.Json.g.cs | 49 + ...els.ChatCompletionResponseObject.Json.g.cs | 49 + ...ther.Models.ChatCompletionStream.Json.g.cs | 49 + ...ChatCompletionSystemMessageParam.Json.g.cs | 49 + ...ether.Models.ChatCompletionToken.Json.g.cs | 49 + ...gether.Models.ChatCompletionTool.Json.g.cs | 49 + ...odels.ChatCompletionToolFunction.Json.g.cs | 49 + ...CompletionToolFunctionParameters.Json.g.cs | 49 + ...s.ChatCompletionToolMessageParam.Json.g.cs | 49 + ...ChatCompletionUserMessageContent.Json.g.cs | 49 + ...essageContentMultimodalItemAudio.Json.g.cs | 49 + ...ntentMultimodalItemAudioAudioUrl.Json.g.cs | 49 + ...eContentMultimodalItemInputAudio.Json.g.cs | 49 + ...ltimodalItemInputAudioInputAudio.Json.g.cs | 49 + ...ageContentMultimodalItemVariant1.Json.g.cs | 49 + ...ageContentMultimodalItemVariant2.Json.g.cs | 49 + ...ntMultimodalItemVariant2ImageUrl.Json.g.cs | 49 + ...essageContentMultimodalItemVideo.Json.g.cs | 49 + ...ntentMultimodalItemVideoVideoUrl.Json.g.cs | 49 + ...s.ChatCompletionUserMessageParam.Json.g.cs | 49 + ...Models.ClusterAddOnCreateRequest.Json.g.cs | 49 + ...ther.Models.ClusterAddOnCreateRequest.g.cs | 18 +- ...odels.ClusterAddOnDeleteResponse.Json.g.cs | 49 + ...Models.ClusterAddOnUpdateRequest.Json.g.cs | 49 + ...ther.Models.ClusterAddOnUpdateRequest.g.cs | 6 +- ...Models.ClusterAddOnsListResponse.Json.g.cs | 49 + ....Models.ClusterDriverVersionInfo.Json.g.cs | 49 + ...ther.Models.ClusterIngressConfig.Json.g.cs | 49 + ...er.Models.ClusterPhaseTransition.Json.g.cs | 49 + .../Together.Models.CommentBody.Json.g.cs | 49 + ...Together.Models.CompletionChoice.Json.g.cs | 49 + ...her.Models.CompletionChoiceDelta.Json.g.cs | 49 + ...ompletionChoiceDeltaFunctionCall.Json.g.cs | 49 + ...Models.CompletionChoicesDataItem.Json.g.cs | 49 + .../Together.Models.CompletionChunk.Json.g.cs | 49 + ...her.Models.CompletionChunkObject.Json.g.cs | 49 + .../Together.Models.CompletionEvent.Json.g.cs | 49 + ...ogether.Models.CompletionRequest.Json.g.cs | 49 + .../Together.Models.CompletionRequest.g.cs | 34 +- ...odels.CompletionRequestLogitBias.Json.g.cs | 49 + ...her.Models.CompletionRequestLogitBias.g.cs | 2 +- ...gether.Models.CompletionResponse.Json.g.cs | 49 + ....Models.CompletionResponseObject.Json.g.cs | 49 + ...Together.Models.CompletionStream.Json.g.cs | 49 + .../Together.Models.CompletionToken.Json.g.cs | 49 + .../Together.Models.ContainerStatus.Json.g.cs | 49 + ...her.Models.CosineLRSchedulerArgs.Json.g.cs | 49 + ...Together.Models.CosineLRSchedulerArgs.g.cs | 12 +- ...gether.Models.CreateBatchRequest.Json.g.cs | 49 + ...r.Models.CreateDeploymentRequest.Json.g.cs | 49 + ...Models.CreateDeploymentsResponse.Json.g.cs | 49 + ...odels.CreateDeploymentsResponse2.Json.g.cs | 49 + ...CreateDeploymentsSecretsResponse.Json.g.cs | 49 + ...reateDeploymentsSecretsResponse2.Json.g.cs | 49 + ...eploymentsStorageVolumesResponse.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse2.Json.g.cs | 49 + ...her.Models.CreateEndpointRequest.Json.g.cs | 49 + ....Models.CreateFilesUploadRequest.Json.g.cs | 49 + ...ateFineTunesEstimatePriceRequest.Json.g.cs | 49 + ...esEstimatePriceResponseVariant1.Json.g.cs} | 71 +- ...neTunesEstimatePriceResponseVariant1.g.cs} | 22 +- ...nesEstimatePriceResponseVariant2.Json.g.cs | 141 + ...ineTunesEstimatePriceResponseVariant2.g.cs | 63 + ...riceResponseVariant2UnavailableReason.g.cs | 70 + ...er.Models.CreateFineTunesRequest.Json.g.cs | 49 + ...ogether.Models.CreateFineTunesRequest.g.cs | 90 +- ...s.CreateImagesGenerationsRequest.Json.g.cs | 49 + ...magesGenerationsRequestImageLora.Json.g.cs | 49 + ...ether.Models.CreateSecretRequest.Json.g.cs | 49 + .../Together.Models.CreateVideoBody.Json.g.cs | 49 + ...ether.Models.CreateVolumeRequest.Json.g.cs | 49 + ...ls.CustomMetricAutoscalingConfig.Json.g.cs | 49 + ....Models.CustomMetricAutoscalingConfig.g.cs | 4 +- .../Together.Models.DashboardConfig.Json.g.cs | 49 + .../Together.Models.DashboardState.Json.g.cs | 49 + .../Together.Models.DataItem3.Json.g.cs | 49 + .../Together.Models.DeABExperiment.Json.g.cs | 141 + .../Together.Models.DeABExperiment.g.cs | 154 + ...ther.Models.DeABExperimentMember.Json.g.cs | 141 + .../Together.Models.DeABExperimentMember.g.cs | 72 + ...ether.Models.DeABExperimentMemberRole.g.cs | 51 + .../Together.Models.DeAccessEntry.Json.g.cs | 141 + .../Together.Models.DeAccessEntry.g.cs | 59 + .../Together.Models.DeAdapterEntry.Json.g.cs | 141 + .../Together.Models.DeAdapterEntry.g.cs | 105 + ...ether.Models.DeAddAdapterRequest.Json.g.cs | 141 + .../Together.Models.DeAddAdapterRequest.g.cs | 69 + .../Together.Models.DeAnalyticsData.Json.g.cs | 141 + .../Together.Models.DeAnalyticsData.g.cs | 90 + .../Together.Models.DeAutoscaling.Json.g.cs | 141 + .../Together.Models.DeAutoscaling.g.cs | 101 + ...her.Models.DeAutoscalingResponse.Json.g.cs | 141 + ...Together.Models.DeAutoscalingResponse.g.cs | 272 + ...ls.DeAutoscalingResponseVariant2.Json.g.cs | 141 + ....Models.DeAutoscalingResponseVariant2.g.cs | 19 + ...ogether.Models.DeBlueGreenConfig.Json.g.cs | 141 + .../Together.Models.DeBlueGreenConfig.g.cs | 19 + .../Together.Models.DeCanaryConfig.Json.g.cs | 141 + .../Together.Models.DeCanaryConfig.g.cs | 58 + ...er.Models.DeCancelRolloutRequest.Json.g.cs | 141 + ...ogether.Models.DeCancelRolloutRequest.g.cs | 70 + ...els.DeCancelRolloutRequestDisposition.g.cs | 51 + .../Together.Models.DeCertification.Json.g.cs | 141 + .../Together.Models.DeCertification.g.cs | 142 + ...dels.DeCertificationCertificationType.g.cs | 51 + ...Together.Models.DeCertificationTarget.g.cs | 51 + .../Together.Models.DeConfig.Json.g.cs | 141 + .../Generated/Together.Models.DeConfig.g.cs | 92 + ...er.Models.DeConfigDeploymentFramework.g.cs | 69 + .../Together.Models.DeConfigEngineType.g.cs | 75 + ...Together.Models.DeConfigSelector.Json.g.cs | 141 + .../Together.Models.DeConfigSelector.g.cs | 68 + ...dels.DeCreateABExperimentRequest.Json.g.cs | 141 + ...er.Models.DeCreateABExperimentRequest.g.cs | 70 + ...Models.DeCreateDeploymentRequest.Json.g.cs | 141 + ...ther.Models.DeCreateDeploymentRequest.g.cs | 137 + ...r.Models.DeCreateEndpointRequest.Json.g.cs | 141 + ...gether.Models.DeCreateEndpointRequest.g.cs | 61 + ...els.DeCreateEndpointRequestVisibility.g.cs | 52 + ...ther.Models.DeCreateModelRequest.Json.g.cs | 141 + .../Together.Models.DeCreateModelRequest.g.cs | 82 + ....Models.DeCreateRemoteUploadSpec.Json.g.cs | 141 + ...ether.Models.DeCreateRemoteUploadSpec.g.cs | 70 + ...er.Models.DeCreateRolloutRequest.Json.g.cs | 141 + ...ogether.Models.DeCreateRolloutRequest.g.cs | 148 + ...odels.DeCreateRolloutRequestEnum.Json.g.cs | 141 + ...her.Models.DeCreateRolloutRequestEnum.g.cs | 19 + ...dels.DeCreateRolloutRequestEnum2.Json.g.cs | 141 + ...er.Models.DeCreateRolloutRequestEnum2.g.cs | 19 + ...dels.DeCreateRolloutRequestEnum3.Json.g.cs | 141 + ...er.Models.DeCreateRolloutRequestEnum3.g.cs | 19 + ...s.DeCreateRolloutRequestSourceCleanup.g.cs | 51 + ....DeCreateShadowExperimentRequest.Json.g.cs | 141 + ...odels.DeCreateShadowExperimentRequest.g.cs | 70 + ...ateShadowExperimentTargetRequest.Json.g.cs | 141 + ...DeCreateShadowExperimentTargetRequest.g.cs | 70 + ...Together.Models.DeDeleteResponse.Json.g.cs | 141 + .../Together.Models.DeDeleteResponse.g.cs | 19 + .../Together.Models.DeDeployment.Json.g.cs | 141 + .../Together.Models.DeDeployment.g.cs | 344 + ...Models.DeDeploymentAdapterStatus.Json.g.cs | 141 + ...ther.Models.DeDeploymentAdapterStatus.g.cs | 196 + ...Models.DeDeploymentAdapterStatusState.g.cs | 69 + ...Models.DeDeploymentAnalyticsData.Json.g.cs | 141 + ...ther.Models.DeDeploymentAnalyticsData.g.cs | 90 + ...ether.Models.DeDeploymentMetrics.Json.g.cs | 141 + .../Together.Models.DeDeploymentMetrics.g.cs | 134 + ...gether.Models.DeDeploymentStatus.Json.g.cs | 141 + .../Together.Models.DeDeploymentStatus.g.cs | 82 + ...gether.Models.DeDeploymentStatusState.g.cs | 81 + ...ether.Models.DeDeploymentSummary.Json.g.cs | 141 + .../Together.Models.DeDeploymentSummary.g.cs | 205 + ...ether.Models.DeDeploymentSummaryState.g.cs | 82 + ...Models.DeDeploymentSummaryTrafficMode.g.cs | 51 + ...gether.Models.DeDeploymentTrafficMode.g.cs | 52 + .../Together.Models.DeEndpoint.Json.g.cs | 141 + .../Generated/Together.Models.DeEndpoint.g.cs | 195 + ...ogether.Models.DeEndpointEndpointType.g.cs | 52 + .../Together.Models.DeEndpointEvent.Json.g.cs | 141 + .../Together.Models.DeEndpointEvent.g.cs | 297 + .../Together.Models.DeEndpointEventLevel.g.cs | 63 + ...ther.Models.DeEndpointEventSourceKind.g.cs | 51 + ...ogether.Models.DeEndpointMetrics.Json.g.cs | 141 + .../Together.Models.DeEndpointMetrics.g.cs | 134 + ...Together.Models.DeEndpointUpdate.Json.g.cs | 141 + .../Together.Models.DeEndpointUpdate.g.cs | 82 + ...her.Models.DeEndpointUpdateVisibility.g.cs | 52 + .../Together.Models.DeEndpointVisibility.g.cs | 52 + .../Together.Models.DeErrorMetrics.Json.g.cs | 141 + .../Together.Models.DeErrorMetrics.g.cs | 57 + ...odels.DeErrorMetricsErrorsByType.Json.g.cs | 141 + ...her.Models.DeErrorMetricsErrorsByType.g.cs | 19 + ...els.DeGrantEndpointAccessRequest.Json.g.cs | 141 + ...r.Models.DeGrantEndpointAccessRequest.g.cs | 59 + .../Together.Models.DeHeadroom.Json.g.cs | 141 + .../Generated/Together.Models.DeHeadroom.g.cs | 59 + .../Together.Models.DeHeadroomRelation.g.cs | 51 + ...r.Models.DeInferenceInstanceType.Json.g.cs | 141 + ...gether.Models.DeInferenceInstanceType.g.cs | 131 + ...ogether.Models.DeInlinePlacement.Json.g.cs | 141 + .../Together.Models.DeInlinePlacement.g.cs | 58 + ...er.Models.DeInlinePlacementConstraint.g.cs | 51 + ...Together.Models.DeLatencyMetrics.Json.g.cs | 141 + .../Together.Models.DeLatencyMetrics.g.cs | 134 + ...dels.DeListABExperimentsResponse.Json.g.cs | 141 + ...er.Models.DeListABExperimentsResponse.g.cs | 70 + ...eListABExperimentsResponseObject.Json.g.cs | 141 + ...els.DeListABExperimentsResponseObject.g.cs | 19 + ...er.Models.DeListAdaptersResponse.Json.g.cs | 141 + ...ogether.Models.DeListAdaptersResponse.g.cs | 70 + ...els.DeListAdaptersResponseObject.Json.g.cs | 141 + ...r.Models.DeListAdaptersResponseObject.g.cs | 19 + ...Models.DeListDeploymentsResponse.Json.g.cs | 141 + ...ther.Models.DeListDeploymentsResponse.g.cs | 70 + ....DeListDeploymentsResponseObject.Json.g.cs | 141 + ...odels.DeListDeploymentsResponseObject.g.cs | 19 + ...els.DeListEndpointAccessResponse.Json.g.cs | 141 + ...r.Models.DeListEndpointAccessResponse.g.cs | 46 + ...els.DeListEndpointEventsResponse.Json.g.cs | 141 + ...r.Models.DeListEndpointEventsResponse.g.cs | 70 + ...ListEndpointEventsResponseObject.Json.g.cs | 141 + ...ls.DeListEndpointEventsResponseObject.g.cs | 19 + ...r.Models.DeListEndpointsResponse.Json.g.cs | 141 + ...gether.Models.DeListEndpointsResponse.g.cs | 70 + ...ls.DeListEndpointsResponseObject.Json.g.cs | 141 + ....Models.DeListEndpointsResponseObject.g.cs | 19 + ...ether.Models.DeListFilesResponse.Json.g.cs | 141 + .../Together.Models.DeListFilesResponse.g.cs | 101 + ...r.Models.DeListFilesResponseFile.Json.g.cs | 141 + ...gether.Models.DeListFilesResponseFile.g.cs | 68 + ...Models.DeListFilesResponseObject.Json.g.cs | 141 + ...ther.Models.DeListFilesResponseObject.g.cs | 19 + ...stInferenceInstanceTypesResponse.Json.g.cs | 141 + ....DeListInferenceInstanceTypesResponse.g.cs | 70 + ...renceInstanceTypesResponseObject.Json.g.cs | 141 + ...tInferenceInstanceTypesResponseObject.g.cs | 19 + ...ther.Models.DeListModelsResponse.Json.g.cs | 141 + .../Together.Models.DeListModelsResponse.g.cs | 70 + ...odels.DeListModelsResponseObject.Json.g.cs | 141 + ...her.Models.DeListModelsResponseObject.g.cs | 19 + ....DeListPlacementProfilesResponse.Json.g.cs | 141 + ...odels.DeListPlacementProfilesResponse.g.cs | 70 + ...tPlacementProfilesResponseObject.Json.g.cs | 141 + ...DeListPlacementProfilesResponseObject.g.cs | 19 + ...els.DeListProjectConfigsResponse.Json.g.cs | 141 + ...r.Models.DeListProjectConfigsResponse.g.cs | 70 + ...ListProjectConfigsResponseObject.Json.g.cs | 141 + ...ls.DeListProjectConfigsResponseObject.g.cs | 19 + ...ls.DeListPublicEndpointsResponse.Json.g.cs | 141 + ....Models.DeListPublicEndpointsResponse.g.cs | 70 + ...istPublicEndpointsResponseObject.Json.g.cs | 141 + ...s.DeListPublicEndpointsResponseObject.g.cs | 19 + ...DeListRemoteUploadEventsResponse.Json.g.cs | 141 + ...dels.DeListRemoteUploadEventsResponse.g.cs | 70 + ...RemoteUploadEventsResponseObject.Json.g.cs | 141 + ...eListRemoteUploadEventsResponseObject.g.cs | 19 + ...dels.DeListRemoteUploadsResponse.Json.g.cs | 141 + ...er.Models.DeListRemoteUploadsResponse.g.cs | 70 + ...eListRemoteUploadsResponseObject.Json.g.cs | 141 + ...els.DeListRemoteUploadsResponseObject.g.cs | 19 + ...r.Models.DeListRevisionsResponse.Json.g.cs | 141 + ...gether.Models.DeListRevisionsResponse.g.cs | 68 + ...ls.DeListRevisionsResponseObject.Json.g.cs | 141 + ....Models.DeListRevisionsResponseObject.g.cs | 19 + ....DeListRevisionsResponseRevision.Json.g.cs | 141 + ...odels.DeListRevisionsResponseRevision.g.cs | 93 + ...sionsResponseRevisionValidationStatus.g.cs | 63 + ...er.Models.DeListRolloutsResponse.Json.g.cs | 141 + ...ogether.Models.DeListRolloutsResponse.g.cs | 70 + ...els.DeListRolloutsResponseObject.Json.g.cs | 141 + ...r.Models.DeListRolloutsResponseObject.g.cs | 19 + ...tShadowExperimentTargetsResponse.Json.g.cs | 141 + ...DeListShadowExperimentTargetsResponse.g.cs | 70 + ...wExperimentTargetsResponseObject.Json.g.cs | 141 + ...ShadowExperimentTargetsResponseObject.g.cs | 19 + ....DeListShadowExperimentsResponse.Json.g.cs | 141 + ...odels.DeListShadowExperimentsResponse.g.cs | 70 + ...tShadowExperimentsResponseObject.Json.g.cs | 141 + ...DeListShadowExperimentsResponseObject.g.cs | 19 + ...ls.DeListSupportedModelsResponse.Json.g.cs | 141 + ....Models.DeListSupportedModelsResponse.g.cs | 70 + ...istSupportedModelsResponseObject.Json.g.cs | 141 + ...s.DeListSupportedModelsResponseObject.g.cs | 19 + .../Together.Models.DeMetricResult.Json.g.cs | 141 + .../Together.Models.DeMetricResult.g.cs | 161 + .../Together.Models.DeMetricResultCheck.g.cs | 51 + ...gether.Models.DeMetricResultDirection.g.cs | 51 + ...ogether.Models.DeMetricResultOperator.g.cs | 63 + .../Together.Models.DeMetricResultStat.g.cs | 63 + ...Together.Models.DeMetricResultVerdict.g.cs | 57 + .../Together.Models.DeMetricRule.Json.g.cs | 141 + .../Together.Models.DeMetricRule.g.cs | 104 + ...Together.Models.DeMetricRuleEnum.Json.g.cs | 141 + .../Together.Models.DeMetricRuleEnum.g.cs | 19 + ...ogether.Models.DeMetricRuleEnum2.Json.g.cs | 141 + .../Together.Models.DeMetricRuleEnum2.g.cs | 19 + .../Together.Models.DeMetricRuleStat.g.cs | 63 + ...gether.Models.DeMetricsTimeRange.Json.g.cs | 141 + .../Together.Models.DeMetricsTimeRange.g.cs | 57 + .../Together.Models.DeModel.Json.g.cs | 141 + .../Generated/Together.Models.DeModel.g.cs | 146 + .../Together.Models.DeModelConfig.Json.g.cs | 141 + .../Together.Models.DeModelConfig.g.cs | 118 + ...ogether.Models.DeModelDTypeCount.Json.g.cs | 141 + .../Together.Models.DeModelDTypeCount.g.cs | 59 + .../Together.Models.DeModelExternal.Json.g.cs | 141 + .../Together.Models.DeModelExternal.g.cs | 46 + .../Together.Models.DeModelLicense.Json.g.cs | 141 + .../Together.Models.DeModelLicense.g.cs | 46 + ...ogether.Models.DeModelParameters.Json.g.cs | 141 + .../Together.Models.DeModelParameters.g.cs | 59 + .../Together.Models.DeModelVisibility.g.cs | 52 + .../Together.Models.DeModelWeights.Json.g.cs | 141 + .../Together.Models.DeModelWeights.g.cs | 104 + ...els.DeModelWeightsDraftSpeculatorType.g.cs | 51 + ...els.DeModelWeightsSpeculatorMechanism.g.cs | 57 + .../Together.Models.DeModelWeightsType.g.cs | 57 + .../Together.Models.DePauseInfo.Json.g.cs | 141 + .../Together.Models.DePauseInfo.g.cs | 58 + ...her.Models.DePauseRolloutRequest.Json.g.cs | 141 + ...Together.Models.DePauseRolloutRequest.g.cs | 57 + .../Together.Models.DePlacement.Json.g.cs | 141 + .../Together.Models.DePlacement.g.cs | 295 + ...gether.Models.DePlacementProfile.Json.g.cs | 141 + .../Together.Models.DePlacementProfile.g.cs | 95 + ...ether.Models.DePlacementVariant1.Json.g.cs | 141 + .../Together.Models.DePlacementVariant1.g.cs | 47 + ...ether.Models.DePlacementVariant2.Json.g.cs | 141 + .../Together.Models.DePlacementVariant2.g.cs | 47 + ...r.Models.DePromoteRolloutRequest.Json.g.cs | 141 + ...gether.Models.DePromoteRolloutRequest.g.cs | 46 + ...Together.Models.DePublicEndpoint.Json.g.cs | 141 + .../Together.Models.DePublicEndpoint.g.cs | 107 + .../Together.Models.DeRegion.Json.g.cs | 141 + .../Generated/Together.Models.DeRegion.g.cs | 58 + ...ogether.Models.DeRegressionCheck.Json.g.cs | 141 + .../Together.Models.DeRegressionCheck.g.cs | 60 + ...her.Models.DeRegressionCheckDirection.g.cs | 51 + .../Together.Models.DeRemoteUpload.Json.g.cs | 141 + .../Together.Models.DeRemoteUpload.g.cs | 152 + ...ether.Models.DeRemoteUploadEvent.Json.g.cs | 141 + .../Together.Models.DeRemoteUploadEvent.g.cs | 96 + ...ether.Models.DeRemoteUploadEventLevel.g.cs | 63 + .../Together.Models.DeRemoteUploadStatus.g.cs | 69 + ...Together.Models.DeRequestMetrics.Json.g.cs | 141 + .../Together.Models.DeRequestMetrics.g.cs | 90 + ...questMetricsRequestsByStatusCode.Json.g.cs | 141 + ....DeRequestMetricsRequestsByStatusCode.g.cs | 19 + ...her.Models.DeResourceUtilization.Json.g.cs | 141 + ...Together.Models.DeResourceUtilization.g.cs | 90 + ...er.Models.DeResumeRolloutRequest.Json.g.cs | 141 + ...ogether.Models.DeResumeRolloutRequest.g.cs | 46 + ...Models.DeRevisionValidationError.Json.g.cs | 141 + ...ther.Models.DeRevisionValidationError.g.cs | 68 + ...ls.DeRevokeEndpointAccessRequest.Json.g.cs | 141 + ....Models.DeRevokeEndpointAccessRequest.g.cs | 59 + ...s.DeRevokeEndpointAccessResponse.Json.g.cs | 141 + ...Models.DeRevokeEndpointAccessResponse.g.cs | 19 + .../Together.Models.DeRollingConfig.Json.g.cs | 141 + .../Together.Models.DeRollingConfig.g.cs | 19 + .../Together.Models.DeRollout.Json.g.cs | 141 + .../Generated/Together.Models.DeRollout.g.cs | 227 + ...gether.Models.DeRolloutCondition.Json.g.cs | 141 + .../Together.Models.DeRolloutCondition.g.cs | 91 + ...her.Models.DeRolloutConditionCategory.g.cs | 117 + .../Together.Models.DeRolloutState.g.cs | 100 + .../Together.Models.DeRolloutStatus.Json.g.cs | 141 + .../Together.Models.DeRolloutStatus.g.cs | 81 + .../Together.Models.DeRolloutStep.Json.g.cs | 141 + .../Together.Models.DeRolloutStep.g.cs | 58 + ...ether.Models.DeRolloutStepStatus.Json.g.cs | 141 + .../Together.Models.DeRolloutStepStatus.g.cs | 113 + ...ether.Models.DeRolloutStepStatusState.g.cs | 63 + .../Together.Models.DeRolloutStrategy.g.cs | 58 + .../Together.Models.DeRuntimeInfo.Json.g.cs | 141 + .../Together.Models.DeRuntimeInfo.g.cs | 79 + .../Together.Models.DeScalingMetric.Json.g.cs | 141 + .../Together.Models.DeScalingMetric.g.cs | 83 + .../Together.Models.DeScalingMetricType.g.cs | 57 + .../Together.Models.DeSelector.Json.g.cs | 141 + .../Generated/Together.Models.DeSelector.g.cs | 59 + ...gether.Models.DeShadowExperiment.Json.g.cs | 141 + .../Together.Models.DeShadowExperiment.g.cs | 193 + ...perimentAdaptiveKeyBasedSampling.Json.g.cs | 141 + ...dowExperimentAdaptiveKeyBasedSampling.g.cs | 70 + ...AdaptiveKeyBasedSamplingResponse.Json.g.cs | 141 + ...imentAdaptiveKeyBasedSamplingResponse.g.cs | 70 + ...xperimentAdaptiveUniformSampling.Json.g.cs | 141 + ...adowExperimentAdaptiveUniformSampling.g.cs | 58 + ...tAdaptiveUniformSamplingResponse.Json.g.cs | 141 + ...rimentAdaptiveUniformSamplingResponse.g.cs | 58 + ...DeShadowExperimentEndpointSource.Json.g.cs | 141 + ...dels.DeShadowExperimentEndpointSource.g.cs | 48 + ...ExperimentEndpointSourceResponse.Json.g.cs | 141 + ...hadowExperimentEndpointSourceResponse.g.cs | 48 + ...ShadowExperimentKeyBasedSampling.Json.g.cs | 141 + ...ls.DeShadowExperimentKeyBasedSampling.g.cs | 59 + ...perimentKeyBasedSamplingResponse.Json.g.cs | 141 + ...dowExperimentKeyBasedSamplingResponse.g.cs | 58 + ...odels.DeShadowExperimentSampling.Json.g.cs | 141 + ...her.Models.DeShadowExperimentSampling.g.cs | 461 + ...ShadowExperimentSamplingResponse.Json.g.cs | 141 + ...ls.DeShadowExperimentSamplingResponse.g.cs | 461 + ...perimentSamplingResponseVariant1.Json.g.cs | 141 + ...dowExperimentSamplingResponseVariant1.g.cs | 47 + ...perimentSamplingResponseVariant2.Json.g.cs | 141 + ...dowExperimentSamplingResponseVariant2.g.cs | 47 + ...perimentSamplingResponseVariant3.Json.g.cs | 141 + ...dowExperimentSamplingResponseVariant3.g.cs | 47 + ...perimentSamplingResponseVariant4.Json.g.cs | 141 + ...dowExperimentSamplingResponseVariant4.g.cs | 47 + ...ShadowExperimentSamplingVariant1.Json.g.cs | 141 + ...ls.DeShadowExperimentSamplingVariant1.g.cs | 47 + ...ShadowExperimentSamplingVariant2.Json.g.cs | 141 + ...ls.DeShadowExperimentSamplingVariant2.g.cs | 47 + ...ShadowExperimentSamplingVariant3.Json.g.cs | 141 + ...ls.DeShadowExperimentSamplingVariant3.g.cs | 47 + ...ShadowExperimentSamplingVariant4.Json.g.cs | 141 + ...ls.DeShadowExperimentSamplingVariant4.g.cs | 47 + ....Models.DeShadowExperimentSource.Json.g.cs | 141 + ...ether.Models.DeShadowExperimentSource.g.cs | 47 + ...DeShadowExperimentSourceResponse.Json.g.cs | 141 + ...dels.DeShadowExperimentSourceResponse.g.cs | 47 + ...gether.Models.DeShadowExperimentState.g.cs | 52 + ....Models.DeShadowExperimentTarget.Json.g.cs | 141 + ...ether.Models.DeShadowExperimentTarget.g.cs | 138 + ...eShadowExperimentUniformSampling.Json.g.cs | 141 + ...els.DeShadowExperimentUniformSampling.g.cs | 47 + ...xperimentUniformSamplingResponse.Json.g.cs | 141 + ...adowExperimentUniformSamplingResponse.g.cs | 46 + ...Together.Models.DeSupportedModel.Json.g.cs | 141 + .../Together.Models.DeSupportedModel.g.cs | 315 + ...er.Models.DeSupportedModelCapabilitie.g.cs | 69 + ...eSupportedModelDeploymentProfile.Json.g.cs | 141 + ...els.DeSupportedModelDeploymentProfile.g.cs | 164 + ...gether.Models.DeSupportedModelFeature.g.cs | 57 + ...Models.DeSupportedModelInputModalitie.g.cs | 63 + ...odels.DeSupportedModelOutputModalitie.g.cs | 63 + ...portedModelPerformanceBenchmarks.Json.g.cs | 141 + ...DeSupportedModelPerformanceBenchmarks.g.cs | 68 + ...gether.Models.DeSupportedModelProduct.g.cs | 57 + ...ogether.Models.DeSupportedModelStatus.g.cs | 63 + ...Together.Models.DeThresholdCheck.Json.g.cs | 141 + .../Together.Models.DeThresholdCheck.g.cs | 60 + ...ether.Models.DeThresholdCheckOperator.g.cs | 63 + ...ether.Models.DeThroughputMetrics.Json.g.cs | 141 + .../Together.Models.DeThroughputMetrics.g.cs | 79 + ...her.Models.DeTimeSeriesDataPoint.Json.g.cs | 141 + ...Together.Models.DeTimeSeriesDataPoint.g.cs | 57 + ...dels.DeTimeSeriesDataPointValues.Json.g.cs | 141 + ...er.Models.DeTimeSeriesDataPointValues.g.cs | 19 + .../Together.Models.DeTokenMetrics.Json.g.cs | 141 + .../Together.Models.DeTokenMetrics.g.cs | 79 + ...ether.Models.DeTrafficSplitEntry.Json.g.cs | 141 + .../Together.Models.DeTrafficSplitEntry.g.cs | 65 + ...dels.DeUpdateABExperimentRequest.Json.g.cs | 141 + ...er.Models.DeUpdateABExperimentRequest.g.cs | 68 + ...er.Models.DeUpdateAdapterRequest.Json.g.cs | 141 + ...ogether.Models.DeUpdateAdapterRequest.g.cs | 59 + ...Models.DeUpdateDeploymentRequest.Json.g.cs | 141 + ...ther.Models.DeUpdateDeploymentRequest.g.cs | 68 + ...ther.Models.DeUpdateModelRequest.Json.g.cs | 141 + .../Together.Models.DeUpdateModelRequest.g.cs | 71 + ...Models.DeUpdateModelRequestVisibility.g.cs | 52 + ....DeUpdateShadowExperimentRequest.Json.g.cs | 141 + ...odels.DeUpdateShadowExperimentRequest.g.cs | 68 + ...ateShadowExperimentTargetRequest.Json.g.cs | 141 + ...DeUpdateShadowExperimentTargetRequest.g.cs | 79 + ...ogether.Models.DedicatedEndpoint.Json.g.cs | 49 + ...r.Models.DedicatedEndpointObject.Json.g.cs | 49 + ...Models.DeleteDeploymentsResponse.Json.g.cs | 49 + ...odels.DeleteDeploymentsResponse2.Json.g.cs | 49 + ...odels.DeleteDeploymentsResponse3.Json.g.cs | 49 + ...DeleteDeploymentsSecretsResponse.Json.g.cs | 49 + ...eleteDeploymentsSecretsResponse2.Json.g.cs | 49 + ...eleteDeploymentsSecretsResponse3.Json.g.cs | 49 + ...eploymentsStorageVolumesResponse.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse2.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse3.Json.g.cs | 49 + ...er.Models.DeploymentListResponse.Json.g.cs | 49 + ...els.DeploymentListResponseObject.Json.g.cs | 49 + .../Together.Models.DeploymentLogs.Json.g.cs | 49 + ...er.Models.DeploymentResponseItem.Json.g.cs | 49 + ...els.DeploymentResponseItemObject.Json.g.cs | 49 + ...loymentResponseItemReplicaEvents.Json.g.cs | 49 + ...er.Models.DisplayorExecuteOutput.Json.g.cs | 49 + ...odels.DisplayorExecuteOutputData.Json.g.cs | 49 + ...cuteOutputDataApplicationGeoJson.Json.g.cs | 49 + ...ExecuteOutputDataApplicationJson.Json.g.cs | 49 + ...tputDataApplicationVndVegaV5Json.Json.g.cs | 49 + ...DataApplicationVndVegaliteV4Json.Json.g.cs | 49 + ...ogether.Models.EmbeddingsRequest.Json.g.cs | 49 + ...gether.Models.EmbeddingsResponse.Json.g.cs | 49 + ...odels.EmbeddingsResponseDataItem.Json.g.cs | 49 + ...EmbeddingsResponseDataItemObject.Json.g.cs | 49 + ....Models.EmbeddingsResponseObject.Json.g.cs | 49 + .../Together.Models.EndpointPricing.Json.g.cs | 49 + .../Together.Models.EndpointPricing.g.cs | 4 +- ...ointServiceListEndpointEventsMinLevel.g.cs | 63 + ...ntServiceListEndpointEventsSourceKind.g.cs | 51 + ...ether.Models.EnvironmentVariable.Json.g.cs | 49 + .../Generated/Together.Models.Error.Json.g.cs | 49 + .../Together.Models.ErrorData.Json.g.cs | 49 + .../Together.Models.ErrorDataError.Json.g.cs | 49 + .../Together.Models.ErrorOutput.Json.g.cs | 49 + .../Together.Models.ErrorResponse.Json.g.cs | 49 + .../Together.Models.ErrorVariant2.Json.g.cs | 49 + ...els.EvaluationClassifyParameters.Json.g.cs | 49 + ...Models.EvaluationClassifyResults.Json.g.cs | 49 + ...ther.Models.EvaluationClassifyResults.g.cs | 4 +- ...dels.EvaluationCompareParameters.Json.g.cs | 49 + ...er.Models.EvaluationCompareParameters.g.cs | 44 +- ....Models.EvaluationCompareResults.Json.g.cs | 49 + ...ether.Models.EvaluationCompareResults.g.cs | 35 +- .../Together.Models.EvaluationJob.Json.g.cs | 49 + ...r.Models.EvaluationJobParameters.Json.g.cs | 49 + ...ther.Models.EvaluationJobResults.Json.g.cs | 49 + ...Models.EvaluationJobStatusUpdate.Json.g.cs | 49 + ...odels.EvaluationJudgeModelConfig.Json.g.cs | 49 + ...her.Models.EvaluationJudgeModelConfig.g.cs | 42 +- ...EvaluationJudgeModelConfigModelSource.g.cs | 12 +- ...r.Models.EvaluationModelOrString.Json.g.cs | 49 + ...gether.Models.EvaluationModelOrString.g.cs | 2 +- ...er.Models.EvaluationModelRequest.Json.g.cs | 49 + ...ogether.Models.EvaluationModelRequest.g.cs | 58 +- ...els.EvaluationModelRequestModelSource.g.cs | 13 +- ...gether.Models.EvaluationResponse.Json.g.cs | 49 + ...Models.EvaluationScoreParameters.Json.g.cs | 49 + ...ther.Models.EvaluationScoreParameters.g.cs | 30 +- ...er.Models.EvaluationScoreResults.Json.g.cs | 49 + ...tionScoreResultsAggregatedScores.Json.g.cs | 49 + ...valuationScoreResultsAggregatedScores.g.cs | 12 +- ...er.Models.EvaluationTypedRequest.Json.g.cs | 49 + .../Together.Models.ExecuteRequest.Json.g.cs | 49 + ...gether.Models.ExecuteRequestFile.Json.g.cs | 49 + .../Together.Models.ExecuteResponse.Json.g.cs | 49 + ...s.ExecuteResponseFailedExecution.Json.g.cs | 49 + ...cuteResponseFailedExecutionError.Json.g.cs | 49 + ...ecuteResponseSuccessfulExecution.Json.g.cs | 49 + ...eResponseSuccessfulExecutionData.Json.g.cs | 49 + ...ExecutionDataOutputDiscriminator.Json.g.cs | 49 + ...DataOutputDisplayorExecuteOutput.Json.g.cs | 49 + ...OutputDisplayorExecuteOutputData.Json.g.cs | 49 + ...cuteOutputDataApplicationGeoJson.Json.g.cs | 49 + ...ExecuteOutputDataApplicationJson.Json.g.cs | 49 + ...tputDataApplicationVndVegaV5Json.Json.g.cs | 49 + ...DataApplicationVndVegaliteV4Json.Json.g.cs | 49 + ...ulExecutionDataOutputErrorOutput.Json.g.cs | 49 + ...lExecutionDataOutputStreamOutput.Json.g.cs | 49 + ...gether.Models.FileDeleteResponse.Json.g.cs | 49 + .../Together.Models.FileInfo.Json.g.cs | 49 + .../Together.Models.FileList.Json.g.cs | 49 + .../Together.Models.FileProcessingStatus.g.cs | 78 + .../Together.Models.FileResponse.Json.g.cs | 49 + .../Together.Models.FileResponse.g.cs | 35 +- ...gether.Models.FileResponseObject.Json.g.cs | 49 + ...ther.Models.FileValidationReport.Json.g.cs | 141 + .../Together.Models.FileValidationReport.g.cs | 172 + ....Models.FileValidationReportErrorType.g.cs | 45 + ...gether.Models.FineTuneCheckpoint.Json.g.cs | 49 + .../Together.Models.FineTuneCheckpoint.g.cs | 73 +- ...r.Models.FineTuneCheckpointCheckpoint.g.cs | 51 + .../Together.Models.FineTuneEvent.Json.g.cs | 49 + .../Together.Models.FineTuneEvent.g.cs | 73 +- ...ether.Models.FineTuneEventObject.Json.g.cs | 49 + ...ether.Models.FineTuneModelLimits.Json.g.cs | 49 + .../Together.Models.FineTuneModelLimits.g.cs | 91 +- ....FineTuneModelLimitsFullTraining.Json.g.cs | 49 + ....FineTuneModelLimitsLoraTraining.Json.g.cs | 49 + ...odels.FineTunePreviewDetailError.Json.g.cs | 141 + ...her.Models.FineTunePreviewDetailError.g.cs | 47 + ...dels.FineTunePreviewMessageError.Json.g.cs | 141 + ...er.Models.FineTunePreviewMessageError.g.cs | 47 + ...er.Models.FineTunePreviewRequest.Json.g.cs | 141 + ...ogether.Models.FineTunePreviewRequest.g.cs | 99 + ....FineTunePreviewRequestTrainingMethod.g.cs | 46 + ...r.Models.FineTunePreviewResponse.Json.g.cs | 141 + ...gether.Models.FineTunePreviewResponse.g.cs | 96 + ....FineTunePreviewResponseDatasetFormat.g.cs | 57 + ...gether.Models.FineTunePreviewRow.Json.g.cs | 141 + .../Together.Models.FineTunePreviewRow.g.cs | 119 + ...Together.Models.FineTuneProgress.Json.g.cs | 49 + ...er.Models.FinetuneDeleteResponse.Json.g.cs | 49 + .../Together.Models.FinetuneEventType.g.cs | 6 + ...r.Models.FinetuneListCheckpoints.Json.g.cs | 49 + ...gether.Models.FinetuneListEvents.Json.g.cs | 49 + ...Together.Models.FinetuneResponse.Json.g.cs | 49 + .../Together.Models.FinetuneResponse.g.cs | 121 +- ...Models.FinetuneResponseTruncated.Json.g.cs | 49 + ...ther.Models.FinetuneResponseTruncated.g.cs | 68 +- ...her.Models.FinetuneTruncatedList.Json.g.cs | 49 + ...Together.Models.FullTrainingType.Json.g.cs | 49 + ...odels.GPUClusterControlPlaneNode.Json.g.cs | 49 + ...her.Models.GPUClusterControlPlaneNode.g.cs | 27 +- ...r.Models.GPUClusterCreateRequest.Json.g.cs | 49 + ...gether.Models.GPUClusterCreateRequest.g.cs | 13 - ....Models.GPUClusterDeleteResponse.Json.g.cs | 49 + ...r.Models.GPUClusterGPUWorkerNode.Json.g.cs | 49 + ...gether.Models.GPUClusterGPUWorkerNode.g.cs | 115 +- .../Together.Models.GPUClusterInfo.Json.g.cs | 49 + .../Together.Models.GPUClusterInfo.g.cs | 136 +- ...els.GPUClusterNodeLifecycleEvent.Json.g.cs | 141 + ...r.Models.GPUClusterNodeLifecycleEvent.g.cs | 83 + ...r.Models.GPUClusterUpdateRequest.Json.g.cs | 49 + ...gether.Models.GPUClusterUpdateRequest.g.cs | 11 + ...Together.Models.GPUClusterVolume.Json.g.cs | 49 + .../Together.Models.GPUClusters.Json.g.cs | 49 + ...r.Models.GPUClustersSharedVolume.Json.g.cs | 49 + ...lustersSharedVolumeCreateRequest.Json.g.cs | 49 + ....GPUClustersSharedVolumeCreateRequest.g.cs | 13 +- ...ustersSharedVolumeDeleteResponse.Json.g.cs | 49 + ...lustersSharedVolumeUpdateRequest.Json.g.cs | 49 + ....Models.GPUClustersSharedVolumes.Json.g.cs | 49 + ...odels.GetDeploymentsLogsResponse.Json.g.cs | 49 + ...dels.GetDeploymentsLogsResponse2.Json.g.cs | 49 + ...er.Models.GetDeploymentsResponse.Json.g.cs | 49 + ...r.Models.GetDeploymentsResponse2.Json.g.cs | 49 + ...r.Models.GetDeploymentsResponse3.Json.g.cs | 49 + ...ls.GetDeploymentsSecretsResponse.Json.g.cs | 49 + ...s.GetDeploymentsSecretsResponse2.Json.g.cs | 49 + ...s.GetDeploymentsSecretsResponse3.Json.g.cs | 49 + ...ls.GetDeploymentsStorageResponse.Json.g.cs | 49 + ...s.GetDeploymentsStorageResponse2.Json.g.cs | 49 + ...s.GetDeploymentsStorageResponse3.Json.g.cs | 49 + ...GetDeploymentsStorageUrlResponse.Json.g.cs | 49 + ...etDeploymentsStorageUrlResponse2.Json.g.cs | 49 + ...etDeploymentsStorageUrlResponse3.Json.g.cs | 49 + ...eploymentsStorageVolumesResponse.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse2.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse3.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse4.Json.g.cs | 49 + ...ationJobStatusAndResultsResponse.Json.g.cs | 49 + ...dels.GetFineTunesMetricsResponse.Json.g.cs | 49 + ...etFineTunesMetricsResponseMetric.Json.g.cs | 49 + ...GetFineTunesModelsLimitsResponse.Json.g.cs | 49 + ...FineTunesModelsSupportedResponse.Json.g.cs | 49 + ...s.GetFineTunesModelsSupportedResponse.g.cs | 14 +- ...lsSupportedResponseDetailedModel.Json.g.cs | 141 + ...sModelsSupportedResponseDetailedModel.g.cs | 59 + ...ther.Models.GetModelListResponse.Json.g.cs | 49 + ...her.Models.HTTPAutoscalingConfig.Json.g.cs | 49 + ...ther.Models.HardwareAvailability.Json.g.cs | 49 + .../Together.Models.HardwareSpec.Json.g.cs | 49 + .../Together.Models.HardwareSpec.g.cs | 4 +- ...gether.Models.HardwareWithStatus.Json.g.cs | 49 + ....Models.HardwareWithStatusObject.Json.g.cs | 49 + .../Together.Models.HeadlampConfig.Json.g.cs | 141 + .../Together.Models.HeadlampConfig.g.cs | 46 + .../Together.Models.HeadlampState.Json.g.cs | 141 + .../Together.Models.HeadlampState.g.cs | 19 + ...veHealthCheckAlertsSeverityFilterItem.g.cs | 57 + ...iceListPassiveHealthCheckAlertsStatus.g.cs | 57 + .../Together.Models.ImageResponse.Json.g.cs | 49 + ...ther.Models.ImageResponseDataB64.Json.g.cs | 49 + ...ageResponseDataItemDiscriminator.Json.g.cs | 49 + ...ther.Models.ImageResponseDataUrl.Json.g.cs | 49 + ...ether.Models.ImageResponseObject.Json.g.cs | 49 + ...Together.Models.InferenceWarning.Json.g.cs | 49 + .../Together.Models.IngressConfig.Json.g.cs | 49 + .../Together.Models.IngressState.Json.g.cs | 49 + ...her.Models.InstanceClusterConfig.Json.g.cs | 49 + ...Together.Models.InstanceClusterConfig.g.cs | 24 +- ...her.Models.InstanceTypesResponse.Json.g.cs | 49 + ...ogether.Models.InterpreterOutput.Json.g.cs | 49 + ...s.InterpreterOutputDiscriminator.Json.g.cs | 49 + ...eterOutputDisplayorExecuteOutput.Json.g.cs | 49 + ...OutputDisplayorExecuteOutputData.Json.g.cs | 49 + ...cuteOutputDataApplicationGeoJson.Json.g.cs | 49 + ...ExecuteOutputDataApplicationJson.Json.g.cs | 49 + ...tputDataApplicationVndVegaV5Json.Json.g.cs | 49 + ...DataApplicationVndVegaliteV4Json.Json.g.cs | 49 + ...els.InterpreterOutputErrorOutput.Json.g.cs | 49 + ...ls.InterpreterOutputStreamOutput.Json.g.cs | 49 + ...er.Models.JobInfoSuccessResponse.Json.g.cs | 49 + ...odels.JobInfoSuccessResponseArgs.Json.g.cs | 49 + ...bInfoSuccessResponseStatusUpdate.Json.g.cs | 49 + ...r.Models.JobsInfoSuccessResponse.Json.g.cs | 49 + .../Together.Models.KubernetesEvent.Json.g.cs | 49 + .../Together.Models.LRScheduler.Json.g.cs | 49 + ...her.Models.LinearLRSchedulerArgs.Json.g.cs | 49 + ...Together.Models.LinearLRSchedulerArgs.g.cs | 8 +- ...ther.Models.ListAdaptersResponse.Json.g.cs | 141 + .../Together.Models.ListAdaptersResponse.g.cs | 56 + ...els.ListAdaptersResponseDataItem.Json.g.cs | 141 + ...r.Models.ListAdaptersResponseDataItem.g.cs | 64 + ...ls.ListAvailibilityZonesResponse.Json.g.cs | 49 + .../Together.Models.ListEndpoint.Json.g.cs | 49 + ...gether.Models.ListEndpointObject.Json.g.cs | 49 + ...her.Models.ListEndpointsResponse.Json.g.cs | 49 + ...dels.ListEndpointsResponseObject.Json.g.cs | 49 + ...ther.Models.ListHardwareResponse.Json.g.cs | 49 + ...odels.ListHardwareResponseObject.Json.g.cs | 49 + ...gether.Models.ListModelResourcesStatu.g.cs | 75 + ...PassiveHealthCheckAlertsResponse.Json.g.cs | 141 + ....ListPassiveHealthCheckAlertsResponse.g.cs | 59 + ....Models.ListRemediationsResponse.Json.g.cs | 49 + ...ether.Models.ListSecretsResponse.Json.g.cs | 49 + ...Models.ListSecretsResponseObject.Json.g.cs | 49 + ...ther.Models.ListTrainingSessionsStatu.g.cs | 75 + ...gether.Models.ListVoicesResponse.Json.g.cs | 49 + ...ether.Models.ListVolumesResponse.Json.g.cs | 49 + ...Models.ListVolumesResponseObject.Json.g.cs | 49 + ...Together.Models.LoRATrainingType.Json.g.cs | 49 + .../Together.Models.LoRATrainingType.g.cs | 10 +- .../Together.Models.LogprobsPart.Json.g.cs | 49 + .../Together.Models.ModelInfo.Json.g.cs | 49 + .../Together.Models.ModelInfoObject.Json.g.cs | 49 + ...gether.Models.ModelUploadRequest.Json.g.cs | 49 + ...odels.ModelUploadSuccessResponse.Json.g.cs | 49 + ...s.ModelUploadSuccessResponseData.Json.g.cs | 49 + .../Together.Models.ModelVoices.Json.g.cs | 49 + ...Together.Models.ModelVoicesVoice.Json.g.cs | 49 + ...Together.Models.MultimodalParams.Json.g.cs | 49 + ...ether.Models.NodePhaseTransition.Json.g.cs | 49 + .../Together.Models.OIDCConfig.Json.g.cs | 49 + ...ether.Models.ObservabilityConfig.Json.g.cs | 49 + .../Together.Models.OutputsItem.Json.g.cs | 49 + ...r.Models.PassiveHealthCheckAlert.Json.g.cs | 141 + ...gether.Models.PassiveHealthCheckAlert.g.cs | 173 + ...ssiveHealthCheckAlertAnnotations.Json.g.cs | 141 + ...ls.PassiveHealthCheckAlertAnnotations.g.cs | 20 + ...odels.PassiveHealthCheckAlertSeverity.g.cs | 58 + ....Models.PatchDeploymentsResponse.Json.g.cs | 49 + ...Models.PatchDeploymentsResponse2.Json.g.cs | 49 + ...Models.PatchDeploymentsResponse3.Json.g.cs | 49 + ....PatchDeploymentsSecretsResponse.Json.g.cs | 49 + ...PatchDeploymentsSecretsResponse2.Json.g.cs | 49 + ...PatchDeploymentsSecretsResponse3.Json.g.cs | 49 + ...eploymentsStorageVolumesResponse.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse2.Json.g.cs | 49 + ...ploymentsStorageVolumesResponse3.Json.g.cs | 49 + .../Together.Models.Pricing.Json.g.cs | 49 + .../Together.Models.PromptPartItem.Json.g.cs | 49 + ...er.Models.QueueAutoscalingConfig.Json.g.cs | 49 + ...gether.Models.QueueCancelRequest.Json.g.cs | 49 + .../Together.Models.QueueCancelRequest.g.cs | 2 +- ...ether.Models.QueueCancelResponse.Json.g.cs | 49 + .../Together.Models.QueueCancelResponse.g.cs | 2 +- ...ogether.Models.QueueClearRequest.Json.g.cs | 141 + .../Together.Models.QueueClearRequest.g.cs | 47 + ...gether.Models.QueueClearResponse.Json.g.cs | 141 + .../Together.Models.QueueClearResponse.g.cs | 47 + .../Together.Models.QueueError.Json.g.cs | 49 + .../Generated/Together.Models.QueueError.g.cs | 2 +- .../Together.Models.QueueJobRequest.Json.g.cs | 49 + .../Together.Models.QueueJobRequest.g.cs | 21 +- ...ether.Models.QueueJobRequestInfo.Json.g.cs | 49 + .../Together.Models.QueueJobRequestInfo.g.cs | 6 +- ...er.Models.QueueJobRequestPayload.Json.g.cs | 49 + ...Together.Models.QueueJobResponse.Json.g.cs | 49 + .../Together.Models.QueueJobResponse.g.cs | 18 +- ...er.Models.QueueJobStatusResponse.Json.g.cs | 49 + ...ogether.Models.QueueJobStatusResponse.g.cs | 2 +- ...odels.QueueJobStatusResponseInfo.Json.g.cs | 49 + ...els.QueueJobStatusResponseInputs.Json.g.cs | 49 + ...ls.QueueJobStatusResponseOutputs.Json.g.cs | 49 + ...ther.Models.QueueMetricsResponse.Json.g.cs | 49 + .../Together.Models.QueueMetricsResponse.g.cs | 2 +- ...gether.Models.RegionListResponse.Json.g.cs | 49 + ....Models.RegionListResponseRegion.Json.g.cs | 49 + .../Together.Models.Remediation.Json.g.cs | 49 + .../Together.Models.Remediation.g.cs | 40 +- .../Together.Models.RemediationMode.g.cs | 15 +- ...ationServiceListRemediationsModeItem.g.cs} | 32 +- ...ationServiceListRemediationsStateItem.g.cs | 12 + ...ionServiceListRemediationsTriggerItem.g.cs | 51 + .../Together.Models.RemediationState.g.cs | 14 + ...ther.Models.RemoveAdapterRequest.Json.g.cs | 141 + .../Together.Models.RemoveAdapterRequest.g.cs | 47 + ...her.Models.RemoveAdapterResponse.Json.g.cs | 141 + ...Together.Models.RemoveAdapterResponse.g.cs | 53 + .../Together.Models.ReplicaEvent.Json.g.cs | 49 + .../Together.Models.RerankRequest.Json.g.cs | 49 + ...rankRequestDocumentsVariant1Item.Json.g.cs | 49 + .../Together.Models.RerankResponse.Json.g.cs | 49 + ...ther.Models.RerankResponseObject.Json.g.cs | 49 + ...ther.Models.RerankResponseResult.Json.g.cs | 49 + ...els.RerankResponseResultDocument.Json.g.cs | 49 + .../Together.Models.Response.Json.g.cs | 49 + .../Together.Models.ResponseError.Json.g.cs | 49 + .../Together.Models.ResponseFormat.Json.g.cs | 49 + ....Models.ResponseFormatJsonObject.Json.g.cs | 49 + ....Models.ResponseFormatJsonSchema.Json.g.cs | 49 + ...sponseFormatJsonSchemaJsonSchema.Json.g.cs | 49 + ...FormatJsonSchemaJsonSchemaStrict.Json.g.cs | 49 + ...s.ResponseFormatJsonSchemaSchema.Json.g.cs | 49 + ...gether.Models.ResponseFormatText.Json.g.cs | 49 + ...er.Models.RlAdamWOptimizerConfig.Json.g.cs | 141 + ...ogether.Models.RlAdamWOptimizerConfig.g.cs | 19 + ...er.Models.RlAdamWOptimizerParams.Json.g.cs | 49 + ...ogether.Models.RlAdamWOptimizerParams.g.cs | 44 +- ...els.RlCheckpointDownloadResponse.Json.g.cs | 49 + ...Together.Models.RlCheckpointFile.Json.g.cs | 49 + ...ogether.Models.RlCispoLossInputs.Json.g.cs | 141 + .../Together.Models.RlCispoLossInputs.g.cs | 59 + ...ogether.Models.RlCispoLossParams.Json.g.cs | 141 + .../Together.Models.RlCispoLossParams.g.cs | 67 + .../Together.Models.RlComputeConfig.Json.g.cs | 141 + .../Together.Models.RlComputeConfig.g.cs | 50 + ...els.RlComputeConfigCreateRequest.Json.g.cs | 141 + ...r.Models.RlComputeConfigCreateRequest.g.cs | 51 + ...ls.RlCreateModelResourcesRequest.Json.g.cs | 141 + ....Models.RlCreateModelResourcesRequest.g.cs | 88 + ....Models.RlCrossEntropyLossParams.Json.g.cs | 49 + ...dels.RlCustomForwardBackwardBody.Json.g.cs | 141 + ...er.Models.RlCustomForwardBackwardBody.g.cs | 59 + ...RlCustomForwardBackwardOperation.Json.g.cs | 141 + ...dels.RlCustomForwardBackwardOperation.g.cs | 88 + ...ls.RlCustomForwardBackwardResult.Json.g.cs | 141 + ....Models.RlCustomForwardBackwardResult.g.cs | 19 + .../Together.Models.RlDroLossInputs.Json.g.cs | 141 + .../Together.Models.RlDroLossInputs.g.cs | 59 + .../Together.Models.RlDroLossParams.Json.g.cs | 141 + .../Together.Models.RlDroLossParams.g.cs | 50 + .../Together.Models.RlEncodedText.Json.g.cs | 49 + ...her.Models.RlForwardBackwardBody.Json.g.cs | 49 + ...odels.RlForwardBackwardOperation.Json.g.cs | 49 + ...r.Models.RlForwardBackwardResult.Json.g.cs | 49 + ...s.RlForwardBackwardResultMetrics.Json.g.cs | 49 + .../Together.Models.RlForwardBody.Json.g.cs | 141 + .../Together.Models.RlForwardBody.g.cs | 47 + ...gether.Models.RlForwardOperation.Json.g.cs | 141 + .../Together.Models.RlForwardOperation.g.cs | 88 + .../Together.Models.RlForwardResult.Json.g.cs | 141 + .../Together.Models.RlForwardResult.g.cs | 47 + ...Together.Models.RlGRPOLossInputs.Json.g.cs | 49 + ...Together.Models.RlGRPOLossParams.Json.g.cs | 49 + .../Together.Models.RlGRPOLossParams.g.cs | 68 +- .../Together.Models.RlGRPOLossRatioType.g.cs | 52 + ...s.RlImportanceSamplingLossInputs.Json.g.cs | 141 + ...Models.RlImportanceSamplingLossInputs.g.cs | 59 + ...her.Models.RlInferenceCheckpoint.Json.g.cs | 49 + ...s.RlInferenceCheckpointOperation.Json.g.cs | 49 + ...lInferenceCheckpointRegistration.Json.g.cs | 49 + ...dels.RlInferenceCheckpointResult.Json.g.cs | 49 + .../Together.Models.RlInputChunk.Json.g.cs | 49 + .../Together.Models.RlListMeta.Json.g.cs | 49 + .../Together.Models.RlLoraConfig.Json.g.cs | 49 + .../Together.Models.RlLoraConfig.g.cs | 42 +- ...Together.Models.RlLossAdvantages.Json.g.cs | 49 + .../Together.Models.RlLossAdvantages.g.cs | 4 +- .../Together.Models.RlLossConfig.Json.g.cs | 49 + .../Together.Models.RlLossConfig.g.cs | 29 +- .../Together.Models.RlLossInputs.Json.g.cs | 49 + .../Together.Models.RlLossInputs.g.cs | 52 +- .../Together.Models.RlLossLogprobs.Json.g.cs | 49 + .../Together.Models.RlLossLogprobs.g.cs | 4 +- .../Together.Models.RlLossMask.Json.g.cs | 49 + ...gether.Models.RlLossTargetTokens.Json.g.cs | 49 + .../Generated/Together.Models.RlLossType.g.cs | 25 + ...her.Models.RlModelFullModeConfig.Json.g.cs | 141 + ...Together.Models.RlModelFullModeConfig.g.cs | 65 + ...er.Models.RlModelGeneratorConfig.Json.g.cs | 141 + ...ogether.Models.RlModelGeneratorConfig.g.cs | 62 + .../Together.Models.RlModelInput.Json.g.cs | 49 + ...her.Models.RlModelLoraModeConfig.Json.g.cs | 141 + ...Together.Models.RlModelLoraModeConfig.g.cs | 80 + ...Together.Models.RlModelResources.Json.g.cs | 141 + .../Together.Models.RlModelResources.g.cs | 173 + ...her.Models.RlModelResourcesError.Json.g.cs | 141 + ...Together.Models.RlModelResourcesError.g.cs | 78 + ...ther.Models.RlModelResourcesErrorCode.g.cs | 51 + ...delResourcesEstimateCostResponse.Json.g.cs | 141 + ....RlModelResourcesEstimateCostResponse.g.cs | 65 + ...els.RlModelResourcesListResponse.Json.g.cs | 141 + ...r.Models.RlModelResourcesListResponse.g.cs | 59 + ...ogether.Models.RlModelResourcesStatus.g.cs | 75 + ...r.Models.RlModelSamplingDefaults.Json.g.cs | 141 + ...gether.Models.RlModelSamplingDefaults.g.cs | 95 + ...ther.Models.RlModelTrainerConfig.Json.g.cs | 141 + .../Together.Models.RlModelTrainerConfig.g.cs | 57 + ...her.Models.RlMuonOptimizerConfig.Json.g.cs | 141 + ...Together.Models.RlMuonOptimizerConfig.g.cs | 49 + ...her.Models.RlMuonOptimizerParams.Json.g.cs | 141 + ...Together.Models.RlMuonOptimizerParams.g.cs | 108 + ...Together.Models.RlMuonScalingStrategy.g.cs | 57 + .../Together.Models.RlOptimStepBody.Json.g.cs | 49 + .../Together.Models.RlOptimStepBody.g.cs | 57 +- ...ther.Models.RlOptimStepOperation.Json.g.cs | 49 + ...ogether.Models.RlOptimStepResult.Json.g.cs | 49 + ...ogether.Models.RlOptimizerConfig.Json.g.cs | 141 + .../Together.Models.RlOptimizerConfig.g.cs | 57 + .../Together.Models.RlPPOLossInputs.Json.g.cs | 141 + .../Together.Models.RlPPOLossInputs.g.cs | 59 + .../Together.Models.RlPPOLossParams.Json.g.cs | 141 + .../Together.Models.RlPPOLossParams.g.cs | 67 + ...er.Models.RlPolicyVersionSegment.Json.g.cs | 141 + ...ogether.Models.RlPolicyVersionSegment.g.cs | 65 + .../Together.Models.RlSampleBody.Json.g.cs | 49 + .../Together.Models.RlSampleBody.g.cs | 4 +- ...ogether.Models.RlSampleOperation.Json.g.cs | 49 + .../Together.Models.RlSampleResult.Json.g.cs | 49 + .../Together.Models.RlSampleResult.g.cs | 13 +- .../Together.Models.RlSampleRollout.Json.g.cs | 49 + .../Together.Models.RlSampleRollout.g.cs | 16 +- ...Together.Models.RlSampleSequence.Json.g.cs | 49 + ...Together.Models.RlSamplingParams.Json.g.cs | 49 + .../Together.Models.RlSamplingParams.g.cs | 36 +- .../Together.Models.RlSessionType.g.cs | 58 - ...ls.RlStartTrainingSessionRequest.Json.g.cs | 49 + ....Models.RlStartTrainingSessionRequest.g.cs | 52 +- ...Together.Models.RlSupportedModel.Json.g.cs | 141 + .../Together.Models.RlSupportedModel.g.cs | 72 + ...ls.RlSupportedModelsListResponse.Json.g.cs | 141 + ....Models.RlSupportedModelsListResponse.g.cs | 47 + ....Models.RlTargetLogprobGradients.Json.g.cs | 141 + ...ether.Models.RlTargetLogprobGradients.g.cs | 64 + ...Together.Models.RlTargetLogprobs.Json.g.cs | 141 + .../Together.Models.RlTargetLogprobs.g.cs | 50 + ...ther.Models.RlTrainingCheckpoint.Json.g.cs | 49 + ...ls.RlTrainingCheckpointOperation.Json.g.cs | 49 + ...odels.RlTrainingCheckpointResult.Json.g.cs | 49 + ....Models.RlTrainingOperationError.Json.g.cs | 49 + ...Together.Models.RlTrainingSample.Json.g.cs | 49 + .../Together.Models.RlTrainingSample.g.cs | 13 +- ...ogether.Models.RlTrainingSession.Json.g.cs | 49 + .../Together.Models.RlTrainingSession.g.cs | 60 +- ...er.Models.RlTrainingSessionError.Json.g.cs | 141 + ...ogether.Models.RlTrainingSessionError.g.cs | 78 + ...her.Models.RlTrainingSessionErrorCode.g.cs | 63 + ...s.RlTrainingSessionsListResponse.Json.g.cs | 49 + .../Together.Models.RlWeightSyncType.g.cs | 64 + ...dels.RolloutServiceListRolloutsFilter.g.cs | 51 + ...gether.Models.SecretResponseItem.Json.g.cs | 49 + ....Models.SecretResponseItemObject.Json.g.cs | 49 + ...ether.Models.SessionListResponse.Json.g.cs | 49 + ...dels.SessionListResponseResponse.Json.g.cs | 49 + ...SessionListResponseResponseError.Json.g.cs | 49 + ...dels.SessionListResponseVariant2.Json.g.cs | 49 + ....SessionListResponseVariant2Data.Json.g.cs | 49 + ...nListResponseVariant2DataSession.Json.g.cs | 49 + ...ogether.Models.SignedURLResponse.Json.g.cs | 49 + ...ether.Models.SlurmStartupScripts.Json.g.cs | 49 + .../Together.Models.SlurmWebConfig.Json.g.cs | 141 + .../Together.Models.SlurmWebConfig.g.cs | 46 + .../Together.Models.SlurmWebState.Json.g.cs | 141 + .../Together.Models.SlurmWebState.g.cs | 19 + .../Together.Models.StreamOutput.Json.g.cs | 49 + .../Together.Models.StreamSentinel.Json.g.cs | 49 + ...elsServiceListSupportedModelsModality.g.cs | 63 + ...delsServiceListSupportedModelsProduct.g.cs | 57 + .../Together.Models.ToolChoice2.Json.g.cs | 49 + ...gether.Models.ToolChoiceFunction.Json.g.cs | 49 + .../Together.Models.ToolsPart.Json.g.cs | 49 + ...ogether.Models.ToolsPartFunction.Json.g.cs | 49 + ...dels.ToolsPartFunctionParameters.Json.g.cs | 49 + .../Together.Models.TopLogprobs.Json.g.cs | 49 + .../Together.Models.TorchpassConfig.Json.g.cs | 141 + .../Together.Models.TorchpassConfig.g.cs | 46 + .../Together.Models.TorchpassState.Json.g.cs | 141 + .../Together.Models.TorchpassState.g.cs | 19 + ...ogether.Models.TrainingMethodDPO.Json.g.cs | 49 + .../Together.Models.TrainingMethodDPO.g.cs | 20 +- ...ogether.Models.TrainingMethodSFT.Json.g.cs | 49 + ...r.Models.UpdateDeploymentRequest.Json.g.cs | 49 + ...her.Models.UpdateEndpointRequest.Json.g.cs | 49 + ...ether.Models.UpdateSecretRequest.Json.g.cs | 49 + ...ether.Models.UpdateVolumeRequest.Json.g.cs | 49 + .../Together.Models.UsageData.Json.g.cs | 49 + ...gether.Models.VersionHistoryItem.Json.g.cs | 49 + ...ther.Models.VideoFrameImageInput.Json.g.cs | 49 + .../Together.Models.VideoJob.Json.g.cs | 49 + .../Together.Models.VideoJobError.Json.g.cs | 49 + .../Together.Models.VideoJobObject.Json.g.cs | 49 + .../Together.Models.VideoJobOutputs.Json.g.cs | 49 + .../Together.Models.VideoMedia.Json.g.cs | 49 + .../Together.Models.VideoRef.Json.g.cs | 49 + .../Together.Models.VolumeContent.Json.g.cs | 49 + ...ther.Models.VolumeContentRequest.Json.g.cs | 49 + .../Together.Models.VolumeMount.Json.g.cs | 49 + ...gether.Models.VolumeResponseItem.Json.g.cs | 49 + ...VolumeResponseItemVersionHistory.Json.g.cs | 49 + ...els.VolumeServiceListModelsVisibility.g.cs | 51 + .../Together.Models.WhoamiResponse.Json.g.cs | 141 + .../Together.Models.WhoamiResponse.g.cs | 118 + .../Together.ModelsClient.Models.g.cs | 116 +- .../Together.ModelsClient.UploadModel.g.cs | 41 +- .../Generated/Together.ModelsClient.g.cs | 144 +- .../Generated/Together.OneOf.2.Json.g.cs | 49 + .../Generated/Together.OneOf.3.Json.g.cs | 49 + .../Generated/Together.OneOf.4.Json.g.cs | 49 + .../Generated/Together.OneOf.5.Json.g.cs | 49 + ...mentProfileServiceGetPlacementProfile.g.cs | 490 + ...ntProfileServiceListPlacementProfiles.g.cs | 507 + ...ogether.PlacementProfileServiceClient.g.cs | 175 + .../Together.QueueClient.CancelQueueJob.g.cs | 101 +- .../Together.QueueClient.ClearQueue.g.cs | 588 + ...ogether.QueueClient.GetQueueJobStatus.g.cs | 101 +- .../Together.QueueClient.GetQueueMetrics.g.cs | 86 +- .../Together.QueueClient.SubmitQueueJob.g.cs | 95 +- .../Generated/Together.QueueClient.g.cs | 144 +- ...RegionServiceClient.RegionServiceList.g.cs | 41 +- .../Together.RegionServiceClient.g.cs | 144 +- ....RemediationServiceApproveRemediation.g.cs | 63 +- ...t.RemediationServiceCancelRemediation.g.cs | 41 +- ...t.RemediationServiceCreateRemediation.g.cs | 46 +- ...ient.RemediationServiceGetRemediation.g.cs | 41 +- ...nt.RemediationServiceListRemediations.g.cs | 101 +- ...t.RemediationServiceRejectRemediation.g.cs | 41 +- .../Together.RemediationServiceClient.g.cs | 144 +- .../Together.RerankClient.Rerank.g.cs | 131 +- .../Generated/Together.RerankClient.g.cs | 144 +- ...er.RlClient.CreateInferenceCheckpoint.g.cs | 56 +- ...ogether.RlClient.CreateModelResources.g.cs | 532 + ...her.RlClient.CreateTrainingCheckpoint.g.cs | 56 +- ...gether.RlClient.CustomForwardBackward.g.cs | 537 + .../Together.RlClient.DownloadCheckpoint.g.cs | 56 +- ...r.RlClient.EstimateModelResourcesCost.g.cs | 532 + .../Generated/Together.RlClient.Forward.g.cs | 532 + .../Together.RlClient.ForwardBackward.g.cs | 56 +- ...ent.GetCustomForwardBackwardOperation.g.cs | 495 + ....RlClient.GetForwardBackwardOperation.g.cs | 56 +- ...Together.RlClient.GetForwardOperation.g.cs | 495 + ...lient.GetInferenceCheckpointOperation.g.cs | 56 +- .../Together.RlClient.GetModelResources.g.cs | 482 + ...gether.RlClient.GetOptimStepOperation.g.cs | 56 +- .../Together.RlClient.GetSample.g.cs | 56 +- ...Client.GetTrainingCheckpointOperation.g.cs | 56 +- .../Together.RlClient.GetTrainingSession.g.cs | 56 +- .../Together.RlClient.ListModelResources.g.cs | 529 + ...Together.RlClient.ListSupportedModels.g.cs | 506 + ...ogether.RlClient.ListTrainingSessions.g.cs | 110 +- .../Together.RlClient.OptimStep.g.cs | 81 +- .../Generated/Together.RlClient.Sample.g.cs | 58 +- ...ogether.RlClient.StartTrainingSession.g.cs | 80 +- .../Together.RlClient.StopModelResources.g.cs | 500 + ...Together.RlClient.StopTrainingSession.g.cs | 56 +- .../Together/Generated/Together.RlClient.g.cs | 144 +- ...iceClient.RolloutServiceCancelRollout.g.cs | 573 + ...iceClient.RolloutServiceCreateRollout.g.cs | 590 + ...iceClient.RolloutServiceDeleteRollout.g.cs | 519 + ...erviceClient.RolloutServiceGetRollout.g.cs | 503 + ...viceClient.RolloutServiceListRollouts.g.cs | 534 + ...viceClient.RolloutServicePauseRollout.g.cs | 568 + ...ceClient.RolloutServicePromoteRollout.g.cs | 563 + ...iceClient.RolloutServiceResumeRollout.g.cs | 563 + ...viceClient.RolloutServiceStartRollout.g.cs | 503 + .../Together.RolloutServiceClient.g.cs | 175 + ...ecretsClient.CreateDeploymentsSecrets.g.cs | 71 +- ...tsClient.DeleteDeploymentsSecretsById.g.cs | 71 +- ...retsClient.EditDeploymentsSecretsById.g.cs | 86 +- ...r.SecretsClient.GetDeploymentsSecrets.g.cs | 56 +- ...cretsClient.GetDeploymentsSecretsById.g.cs | 71 +- .../Generated/Together.SecretsClient.g.cs | 144 +- ...perimentServiceCreateShadowExperiment.g.cs | 592 + ...t.ShadowExperimentServiceCreateTarget.g.cs | 610 + ...perimentServiceDeleteShadowExperiment.g.cs | 556 + ...t.ShadowExperimentServiceDeleteTarget.g.cs | 569 + ...wExperimentServiceGetShadowExperiment.g.cs | 540 + ...ient.ShadowExperimentServiceGetTarget.g.cs | 553 + ...xperimentServiceListShadowExperiments.g.cs | 571 + ...nt.ShadowExperimentServiceListTargets.g.cs | 570 + ...perimentServiceUpdateShadowExperiment.g.cs | 631 + ...t.ShadowExperimentServiceUpdateTarget.g.cs | 654 + ...ogether.ShadowExperimentServiceClient.g.cs | 175 + ...rviceClient.SharedVolumeServiceCreate.g.cs | 46 +- ...rviceClient.SharedVolumeServiceDelete.g.cs | 41 +- ...eServiceClient.SharedVolumeServiceGet.g.cs | 41 +- ...ServiceClient.SharedVolumeServiceList.g.cs | 43 +- ...rviceClient.SharedVolumeServiceUpdate.g.cs | 41 +- .../Together.SharedVolumeServiceClient.g.cs | 144 +- ...pportedModelsServiceGetSupportedModel.g.cs | 477 + ...ortedModelsServiceListSupportedModels.g.cs | 536 + ...Together.SupportedModelsServiceClient.g.cs | 175 + .../Generated/Together.TogetherClient.g.cs | 131 +- .../Together.VideoClient.CreateVideo.g.cs | 36 +- .../Together.VideoClient.RetrieveVideo.g.cs | 62 +- .../Generated/Together.VideoClient.g.cs | 31 + .../Together.VoicesClient.FetchVoices.g.cs | 41 +- .../Generated/Together.VoicesClient.g.cs | 144 +- ...erviceClient.VolumeServiceCreateModel.g.cs | 542 + ....VolumeServiceCreateRemoteModelUpload.g.cs | 537 + ...erviceClient.VolumeServiceDeleteModel.g.cs | 490 + ...meServiceClient.VolumeServiceGetModel.g.cs | 490 + ...ent.VolumeServiceGetRemoteModelUpload.g.cs | 490 + ...t.VolumeServiceGetRevisionByModelType.g.cs | 503 + ...iceClient.VolumeServiceListModelFiles.g.cs | 506 + ...lient.VolumeServiceListModelRevisions.g.cs | 490 + ...ServiceClient.VolumeServiceListModels.g.cs | 535 + ...t.VolumeServiceListOrganizationModels.g.cs | 507 + ...umeServiceListRemoteModelUploadEvents.g.cs | 520 + ...t.VolumeServiceListRemoteModelUploads.g.cs | 507 + ...erviceClient.VolumeServiceUpdateModel.g.cs | 577 + .../Together.VolumeServiceClient.g.cs | 175 + ...t.DeleteDeploymentsStorageVolumesById.g.cs | 71 +- ...ent.EditDeploymentsStorageVolumesById.g.cs | 86 +- ...ient.GetDeploymentsStorageVolumesById.g.cs | 86 +- .../Generated/Together.VolumesClient.g.cs | 144 +- .../Generated/autosdk.generated-examples.json | 2 +- src/libs/Together/openapi.yaml | 23889 ++++++++++------ 1576 files changed, 167085 insertions(+), 13670 deletions(-) create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs create mode 100644 src/libs/Together/Generated/Together.AccountClient.g.cs create mode 100644 src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs create mode 100644 src/libs/Together/Generated/Together.ConfigServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs create mode 100644 src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs create mode 100644 src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs create mode 100644 src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IABExperimentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs create mode 100644 src/libs/Together/Generated/Together.IAccountClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs create mode 100644 src/libs/Together/Generated/Together.IConfigServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.IDeploymentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs create mode 100644 src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs create mode 100644 src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs create mode 100644 src/libs/Together/Generated/Together.IHealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs create mode 100644 src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs create mode 100644 src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs create mode 100644 src/libs/Together/Generated/Together.IInstanceTypeServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs create mode 100644 src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs create mode 100644 src/libs/Together/Generated/Together.IPlacementProfileServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.Forward.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.GetForwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs create mode 100644 src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.IRolloutServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.IShadowExperimentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs create mode 100644 src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs create mode 100644 src/libs/Together/Generated/Together.ISupportedModelsServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs create mode 100644 src/libs/Together/Generated/Together.IVolumeServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs create mode 100644 src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs create mode 100644 src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestMode.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestModeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRole.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRoleNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeAutoscalingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDisposition.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDispositionNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCertificationTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCertificationTargetNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFramework.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFrameworkNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanup.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusStateNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusStateNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryState.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryStateNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficMode.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficModeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficMode.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficModeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevelNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKind.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKindNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelation.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelationNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraint.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraintNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheck.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheckNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirection.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirectionNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperator.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperatorNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStat.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStatNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdict.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdictNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStat.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStatNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanism.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DePlacement.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirection.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirectionNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevelNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategory.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategoryNullable.g.cs rename src/libs/Together/Generated/{Together.JsonConverters.RlSessionType.g.cs => Together.JsonConverters.DeRolloutState.g.cs} (69%) rename src/libs/Together/Generated/{Together.JsonConverters.RlSessionTypeNullable.g.cs => Together.JsonConverters.DeRolloutStateNullable.g.cs} (71%) create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusStateNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategy.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategyNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentState.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentStateNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitie.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitieNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeature.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeatureNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitie.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitieNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitie.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitieNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProduct.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProductNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperator.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperatorNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKind.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpointNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethod.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormat.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatu.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatuNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatu.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatuNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverity.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverityNullable.g.cs rename src/libs/Together/Generated/{Together.JsonConverters.RemediationServiceListRemediationsMode.g.cs => Together.JsonConverters.RemediationServiceListRemediationsModeItem.g.cs} (80%) rename src/libs/Together/Generated/{Together.JsonConverters.RemediationServiceListRemediationsModeNullable.g.cs => Together.JsonConverters.RemediationServiceListRemediationsModeItemNullable.g.cs} (81%) create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItem.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCode.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCodeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatusNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategy.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategyNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCode.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCodeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncType.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncTypeNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilter.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilterNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModality.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProduct.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibilityNullable.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ApproveRemediationRequestMode.g.cs rename src/libs/Together/Generated/{Together.Models.CreateFineTunesEstimatePriceResponse.Json.g.cs => Together.Models.CreateFineTunesEstimatePriceResponseVariant1.Json.g.cs} (68%) rename src/libs/Together/Generated/{Together.Models.CreateFineTunesEstimatePriceResponse.g.cs => Together.Models.CreateFineTunesEstimatePriceResponseVariant1.g.cs} (80%) create mode 100644 src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeABExperiment.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeABExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeABExperimentMember.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeABExperimentMember.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeABExperimentMemberRole.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAccessEntry.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAccessEntry.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAdapterEntry.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAnalyticsData.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAnalyticsData.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscaling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscaling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCanaryConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCanaryConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCancelRolloutRequestDisposition.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCertification.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCertification.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCertificationCertificationType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCertificationTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfigDeploymentFramework.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfigEngineType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfigSelector.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeConfigSelector.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateEndpointRequestVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateModelRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateModelRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestSourceCleanup.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeleteResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeleteResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeployment.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeployment.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentStatus.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentSummary.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentSummary.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentSummaryState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentSummaryTrafficMode.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeDeploymentTrafficMode.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpoint.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointEndpointType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointEvent.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointEvent.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointEventLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointEventSourceKind.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointUpdate.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointUpdate.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointUpdateVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeEndpointVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeErrorMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeErrorMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeHeadroom.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeHeadroom.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeHeadroomRelation.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeInlinePlacement.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeInlinePlacement.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeInlinePlacementConstraint.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeLatencyMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeLatencyMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListModelsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListModelsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevisionValidationStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResult.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResult.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResultCheck.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResultDirection.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResultOperator.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResultStat.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricResultVerdict.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRule.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRule.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricRuleStat.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModel.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelDTypeCount.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelDTypeCount.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelExternal.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelExternal.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelLicense.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelLicense.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelParameters.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelParameters.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelWeights.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelWeights.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelWeightsDraftSpeculatorType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelWeightsSpeculatorMechanism.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeModelWeightsType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePauseInfo.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePauseInfo.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacement.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacement.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementProfile.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementProfile.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementVariant1.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementVariant1.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementVariant2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePlacementVariant2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePublicEndpoint.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DePublicEndpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRegion.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRegion.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRegressionCheck.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRegressionCheck.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRegressionCheckDirection.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUpload.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUpload.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUploadEventLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRemoteUploadStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRequestMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRequestMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeResourceUtilization.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeResourceUtilization.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevisionValidationError.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevisionValidationError.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRollingConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRollingConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRollout.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutCondition.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutCondition.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutConditionCategory.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStatus.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStep.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStep.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStepStatusState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRolloutStrategy.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRuntimeInfo.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeRuntimeInfo.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeScalingMetric.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeScalingMetric.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeScalingMetricType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSelector.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSelector.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperiment.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModel.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelCapabilitie.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelFeature.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelInputModalitie.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelOutputModalitie.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelProduct.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeSupportedModelStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeThresholdCheck.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeThresholdCheck.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeThresholdCheckOperator.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeThroughputMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeThroughputMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTokenMetrics.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTokenMetrics.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateModelRequestVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsMinLevel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsSourceKind.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FileProcessingStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FileValidationReport.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FileValidationReport.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FileValidationReportErrorType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTuneCheckpointCheckpoint.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewRequestTrainingMethod.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewResponseDatasetFormat.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewRow.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.FineTunePreviewRow.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HeadlampConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HeadlampConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HeadlampState.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HeadlampState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListModelResourcesStatu.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.ListTrainingSessionsStatu.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertSeverity.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.QueueClearRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.QueueClearRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.QueueClearResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.QueueClearResponse.g.cs rename src/libs/Together/Generated/{Together.Models.RemediationServiceListRemediationsMode.g.cs => Together.Models.RemediationServiceListRemediationsModeItem.g.cs} (50%) create mode 100644 src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsTriggerItem.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCispoLossInputs.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCispoLossInputs.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCispoLossParams.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCispoLossParams.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlComputeConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlDroLossInputs.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlDroLossInputs.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlDroLossParams.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlDroLossParams.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardBody.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardBody.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardOperation.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardResult.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlForwardResult.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlGRPOLossRatioType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResources.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesError.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesError.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesErrorCode.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelResourcesStatus.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlMuonScalingStrategy.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlOptimizerConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlOptimizerConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPPOLossInputs.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPPOLossInputs.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPPOLossParams.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPPOLossParams.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.g.cs delete mode 100644 src/libs/Together/Generated/Together.Models.RlSessionType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlSupportedModel.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTargetLogprobs.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTargetLogprobs.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTrainingSessionError.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTrainingSessionError.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlTrainingSessionErrorCode.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RlWeightSyncType.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.RolloutServiceListRolloutsFilter.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SlurmWebConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SlurmWebConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SlurmWebState.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SlurmWebState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsModality.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsProduct.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.TorchpassConfig.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.TorchpassConfig.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.TorchpassState.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.TorchpassState.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.VolumeServiceListModelsVisibility.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs create mode 100644 src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs create mode 100644 src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs create mode 100644 src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs create mode 100644 src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.Forward.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.GetForwardOperation.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs create mode 100644 src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs create mode 100644 src/libs/Together/Generated/Together.RolloutServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs create mode 100644 src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs create mode 100644 src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs create mode 100644 src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs create mode 100644 src/libs/Together/Generated/Together.VolumeServiceClient.g.cs diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs new file mode 100644 index 00000000..8fab9032 --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs @@ -0,0 +1,555 @@ + +#nullable enable + +namespace Together +{ + public partial class ABExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceCreateABExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceCreateABExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceCreateABExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ABExperimentServiceCreateABExperimentSecurityRequirement0, + }; + partial void PrepareABExperimentServiceCreateABExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + global::Together.DeCreateABExperimentRequest request); + partial void PrepareABExperimentServiceCreateABExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + global::Together.DeCreateABExperimentRequest request); + partial void ProcessABExperimentServiceCreateABExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessABExperimentServiceCreateABExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateABExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ABExperimentServiceCreateABExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ABExperimentServiceCreateABExperimentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateABExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareABExperimentServiceCreateABExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ABExperimentServiceCreateABExperimentSecurityRequirements, + operationName: "ABExperimentServiceCreateABExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceCreateABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareABExperimentServiceCreateABExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceCreateABExperiment", + methodName: "ABExperimentServiceCreateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceCreateABExperiment", + methodName: "ABExperimentServiceCreateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceCreateABExperiment", + methodName: "ABExperimentServiceCreateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + 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::Together.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); + ProcessABExperimentServiceCreateABExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceCreateABExperiment", + methodName: "ABExperimentServiceCreateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceCreateABExperiment", + methodName: "ABExperimentServiceCreateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessABExperimentServiceCreateABExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + /// + /// Optional free-form description. + /// + /// + /// Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( + string projectId, + string endpointId, + string name, + global::System.Collections.Generic.IList members, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateABExperimentRequest + { + Name = name, + Description = description, + Members = members, + }; + + return await ABExperimentServiceCreateABExperimentAsync( + projectId: projectId, + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs new file mode 100644 index 00000000..9fbfdc77 --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs @@ -0,0 +1,519 @@ + +#nullable enable + +namespace Together +{ + public partial class ABExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceDeleteABExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceDeleteABExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceDeleteABExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ABExperimentServiceDeleteABExperimentSecurityRequirement0, + }; + partial void PrepareABExperimentServiceDeleteABExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? etag); + partial void PrepareABExperimentServiceDeleteABExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? etag); + partial void ProcessABExperimentServiceDeleteABExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceDeleteABExperimentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ABExperimentServiceDeleteABExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ABExperimentServiceDeleteABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareABExperimentServiceDeleteABExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ABExperimentServiceDeleteABExperimentSecurityRequirements, + operationName: "ABExperimentServiceDeleteABExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceDeleteABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareABExperimentServiceDeleteABExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceDeleteABExperiment", + methodName: "ABExperimentServiceDeleteABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceDeleteABExperiment", + methodName: "ABExperimentServiceDeleteABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceDeleteABExperiment", + methodName: "ABExperimentServiceDeleteABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessABExperimentServiceDeleteABExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceDeleteABExperiment", + methodName: "ABExperimentServiceDeleteABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceDeleteABExperiment", + methodName: "ABExperimentServiceDeleteABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessABExperimentServiceDeleteABExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs new file mode 100644 index 00000000..ceaeaa9b --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Together +{ + public partial class ABExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceGetABExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceGetABExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceGetABExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ABExperimentServiceGetABExperimentSecurityRequirement0, + }; + partial void PrepareABExperimentServiceGetABExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id); + partial void PrepareABExperimentServiceGetABExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id); + partial void ProcessABExperimentServiceGetABExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessABExperimentServiceGetABExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceGetABExperimentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ABExperimentServiceGetABExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ABExperimentServiceGetABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareABExperimentServiceGetABExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ABExperimentServiceGetABExperimentSecurityRequirements, + operationName: "ABExperimentServiceGetABExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceGetABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareABExperimentServiceGetABExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceGetABExperiment", + methodName: "ABExperimentServiceGetABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceGetABExperiment", + methodName: "ABExperimentServiceGetABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceGetABExperiment", + methodName: "ABExperimentServiceGetABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessABExperimentServiceGetABExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceGetABExperiment", + methodName: "ABExperimentServiceGetABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceGetABExperiment", + methodName: "ABExperimentServiceGetABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessABExperimentServiceGetABExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs new file mode 100644 index 00000000..af630ab2 --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace Together +{ + public partial class ABExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceListABExperimentsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceListABExperimentsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceListABExperimentsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ABExperimentServiceListABExperimentsSecurityRequirement0, + }; + partial void PrepareABExperimentServiceListABExperimentsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref int? limit, + ref string? after); + partial void PrepareABExperimentServiceListABExperimentsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + int? limit, + string? after); + partial void ProcessABExperimentServiceListABExperimentsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessABExperimentServiceListABExperimentsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of A/B experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous A/B experiment list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceListABExperimentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ABExperimentServiceListABExperimentsAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of A/B experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous A/B experiment list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ABExperimentServiceListABExperimentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareABExperimentServiceListABExperimentsArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ABExperimentServiceListABExperimentsSecurityRequirements, + operationName: "ABExperimentServiceListABExperimentsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceListABExperimentsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareABExperimentServiceListABExperimentsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceListABExperiments", + methodName: "ABExperimentServiceListABExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceListABExperiments", + methodName: "ABExperimentServiceListABExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceListABExperiments", + methodName: "ABExperimentServiceListABExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + httpMethod: "GET", + 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::Together.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); + ProcessABExperimentServiceListABExperimentsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceListABExperiments", + methodName: "ABExperimentServiceListABExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceListABExperiments", + methodName: "ABExperimentServiceListABExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessABExperimentServiceListABExperimentsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListABExperimentsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListABExperimentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs new file mode 100644 index 00000000..aec639af --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs @@ -0,0 +1,594 @@ + +#nullable enable + +namespace Together +{ + public partial class ABExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceUpdateABExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceUpdateABExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceUpdateABExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ABExperimentServiceUpdateABExperimentSecurityRequirement0, + }; + partial void PrepareABExperimentServiceUpdateABExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? updateMask, + global::Together.DeUpdateABExperimentRequest request); + partial void PrepareABExperimentServiceUpdateABExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? updateMask, + global::Together.DeUpdateABExperimentRequest request); + partial void ProcessABExperimentServiceUpdateABExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateABExperimentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ABExperimentServiceUpdateABExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ABExperimentServiceUpdateABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateABExperimentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareABExperimentServiceUpdateABExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ABExperimentServiceUpdateABExperimentSecurityRequirements, + operationName: "ABExperimentServiceUpdateABExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceUpdateABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareABExperimentServiceUpdateABExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + updateMask: updateMask, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceUpdateABExperiment", + methodName: "ABExperimentServiceUpdateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceUpdateABExperiment", + methodName: "ABExperimentServiceUpdateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceUpdateABExperiment", + methodName: "ABExperimentServiceUpdateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessABExperimentServiceUpdateABExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceUpdateABExperiment", + methodName: "ABExperimentServiceUpdateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ABExperimentServiceUpdateABExperiment", + methodName: "ABExperimentServiceUpdateABExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + httpMethod: "PATCH", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessABExperimentServiceUpdateABExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Updated free-form description. + /// + /// + /// Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( + string projectId, + string endpointId, + string id, + string? updateMask = default, + string? description = default, + global::System.Collections.Generic.IList? members = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateABExperimentRequest + { + Description = description, + Members = members, + Etag = etag, + }; + + return await ABExperimentServiceUpdateABExperimentAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs new file mode 100644 index 00000000..e29ae775 --- /dev/null +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ABExperimentServiceClient : global::Together.IABExperimentServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ABExperimentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ABExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ABExperimentServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ABExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ABExperimentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ABExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs new file mode 100644 index 00000000..8112efec --- /dev/null +++ b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace Together +{ + public partial class AccountClient + { + + private static readonly global::Together.AutoSDKServer[] s_WhoamiServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_WhoamiSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_WhoamiSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_WhoamiSecurityRequirement0, + }; + partial void PrepareWhoamiArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareWhoamiRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessWhoamiResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWhoamiResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity) + ///
+ public async global::System.Threading.Tasks.Task WhoamiAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WhoamiAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity) + ///
+ public async global::System.Threading.Tasks.Task> WhoamiAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWhoamiArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WhoamiSecurityRequirements, + operationName: "WhoamiAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/whoami", + baseUri: ResolveBaseUri( + servers: s_WhoamiServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWhoamiRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Whoami", + methodName: "WhoamiAsync", + pathTemplate: "\"/whoami\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Whoami", + methodName: "WhoamiAsync", + pathTemplate: "\"/whoami\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Whoami", + methodName: "WhoamiAsync", + pathTemplate: "\"/whoami\"", + httpMethod: "GET", + 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::Together.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); + ProcessWhoamiResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Whoami", + methodName: "WhoamiAsync", + pathTemplate: "\"/whoami\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Whoami", + methodName: "WhoamiAsync", + pathTemplate: "\"/whoami\"", + httpMethod: "GET", + 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); + } + // Unauthorized — missing or invalid API key + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Together.ErrorData? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.ErrorData? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + 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); + ProcessWhoamiResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.WhoamiResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.WhoamiResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.AccountClient.g.cs b/src/libs/Together/Generated/Together.AccountClient.g.cs new file mode 100644 index 00000000..151fc44e --- /dev/null +++ b/src/libs/Together/Generated/Together.AccountClient.g.cs @@ -0,0 +1,284 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AccountClient : global::Together.IAccountClient, global::System.IDisposable + { + /// + /// Default environment for APIs + /// + public const string DefaultBaseUrl = "https://api.together.ai/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + + /// + /// Creates a new instance of the AccountClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AccountClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AccountClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs b/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs index 6748f0a6..a4d6c368 100644 --- a/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs +++ b/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AllOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AllOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AllOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs b/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs index ed4d6e64..24491b01 100644 --- a/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs +++ b/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AnyOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs index b245e32e..c3252c69 100644 --- a/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_AudioSpeechServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_AudioSpeechSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -98,7 +111,9 @@ partial void ProcessAudioSpeechResponse( var __pathBuilder = new global::Together.PathBuilder( path: "/audio/speech", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_AudioSpeechServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -344,17 +359,15 @@ partial void ProcessAudioSpeechResponse( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } using var __stream = await __response.Content.ReadAsStreamAsync( @@ -373,16 +386,15 @@ partial void ProcessAudioSpeechResponse( } var __streamedResponse = global::Together.AudioSpeechStreamResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: $"Response deserialization failed for \"{__content}\" ", - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + innerException: null, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); yield return __streamedResponse; } diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs index 4c1a3135..6d1ac466 100644 --- a/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_AudioTranscriptionsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_AudioTranscriptionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -137,7 +150,9 @@ partial void ProcessAudioTranscriptionsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/audio/transcriptions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_AudioTranscriptionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -438,7 +453,7 @@ partial void ProcessAudioTranscriptionsResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // BadRequest + // BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation). if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -463,18 +478,17 @@ partial void ProcessAudioTranscriptionsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -501,18 +515,54 @@ partial void ProcessAudioTranscriptionsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side). + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __exception_413 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -539,18 +589,17 @@ partial void ProcessAudioTranscriptionsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -584,17 +633,15 @@ partial void ProcessAudioTranscriptionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -631,17 +678,15 @@ partial void ProcessAudioTranscriptionsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -657,7 +702,7 @@ partial void ProcessAudioTranscriptionsResponseContent( /// Transcribes audio into text /// /// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for transcription
@@ -677,7 +722,7 @@ partial void ProcessAudioTranscriptionsResponseContent( /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -715,7 +760,7 @@ partial void ProcessAudioTranscriptionsResponseContent( string? language = default, string? prompt = default, global::Together.AudioTranscriptionRequestResponseFormat? responseFormat = default, - float? temperature = default, + double? temperature = default, global::Together.OneOf>? timestampGranularities = default, bool? diarize = default, int? minSpeakers = default, diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs index ece22f0e..6282739e 100644 --- a/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_AudioTranslationsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_AudioTranslationsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -141,7 +154,9 @@ partial void ProcessAudioTranslationsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/audio/translations", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_AudioTranslationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -418,7 +433,7 @@ partial void ProcessAudioTranslationsResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // BadRequest + // BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation). if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -443,18 +458,17 @@ partial void ProcessAudioTranslationsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -481,18 +495,54 @@ partial void ProcessAudioTranslationsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side). + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __exception_413 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -519,18 +569,17 @@ partial void ProcessAudioTranslationsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -564,17 +613,15 @@ partial void ProcessAudioTranslationsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -611,17 +658,15 @@ partial void ProcessAudioTranslationsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -637,7 +682,7 @@ partial void ProcessAudioTranslationsResponseContent( /// Translates audio into English /// /// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for translation
@@ -657,7 +702,7 @@ partial void ProcessAudioTranslationsResponseContent( /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -673,7 +718,7 @@ partial void ProcessAudioTranslationsResponseContent( string? language = default, string? prompt = default, global::Together.AudioTranslationRequestResponseFormat? responseFormat = default, - float? temperature = default, + double? temperature = default, global::Together.OneOf>? timestampGranularities = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs index 136df8f3..88070e0f 100644 --- a/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_RealtimeTranscriptionServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RealtimeTranscriptionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -91,7 +104,7 @@ partial void ProcessRealtimeTranscriptionResponse( /// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
@@ -284,7 +297,7 @@ await RealtimeTranscriptionAsResponseAsync( /// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
@@ -449,7 +462,9 @@ await RealtimeTranscriptionAsResponseAsync( var __pathBuilder = new global::Together.PathBuilder( path: "/realtime", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RealtimeTranscriptionServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model", model) .AddRequiredParameter("input_audio_format", inputAudioFormat.ToValueString()) @@ -695,17 +710,16 @@ await RealtimeTranscriptionAsResponseAsync( __exception_101 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_101 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_101, - statusCode: __response.StatusCode) - { - ResponseBody = __content_101, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_101, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -732,17 +746,15 @@ await RealtimeTranscriptionAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -770,17 +782,15 @@ await RealtimeTranscriptionAsResponseAsync( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs index 0f229fe1..4f81a473 100644 --- a/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_RealtimeTtsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RealtimeTtsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -475,7 +488,9 @@ await RealtimeTtsAsResponseAsync( var __pathBuilder = new global::Together.PathBuilder( path: "/audio/speech/websocket", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RealtimeTtsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("model", model?.ToValueString()) .AddOptionalParameter("voice", voice) @@ -725,17 +740,16 @@ await RealtimeTtsAsResponseAsync( __exception_101 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_101 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_101, - statusCode: __response.StatusCode) - { - ResponseBody = __content_101, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_101, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -762,17 +776,15 @@ await RealtimeTtsAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -800,17 +812,15 @@ await RealtimeTtsAsResponseAsync( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.AudioClient.g.cs b/src/libs/Together/Generated/Together.AudioClient.g.cs index 57377267..9a387980 100644 --- a/src/libs/Together/Generated/Together.AudioClient.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class AudioClient : global::Together.IAudioClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global: public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global: public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the AudioClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs index 2d999b02..1930a432 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class BatchesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateBatchesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateBatchesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -131,7 +144,9 @@ partial void ProcessCreateBatchesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/batches", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateBatchesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,18 +397,17 @@ partial void ProcessCreateBatchesResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -420,18 +434,17 @@ partial void ProcessCreateBatchesResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -458,18 +471,17 @@ partial void ProcessCreateBatchesResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal Server Error if ((int)__response.StatusCode == 500) @@ -496,18 +508,17 @@ partial void ProcessCreateBatchesResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -541,17 +552,15 @@ partial void ProcessCreateBatchesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -588,17 +597,15 @@ partial void ProcessCreateBatchesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs index 89f73a2a..316d0732 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class BatchesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateBatchesByIdCancelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateBatchesByIdCancelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/batches/{id}/cancel", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateBatchesByIdCancelServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -377,18 +392,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -415,18 +429,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -453,18 +466,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Not Found if ((int)__response.StatusCode == 404) @@ -491,18 +503,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal Server Error if ((int)__response.StatusCode == 500) @@ -529,18 +540,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -574,17 +584,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -621,17 +629,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs index 20809fff..a96f2bb2 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class BatchesClient { + private static readonly global::Together.AutoSDKServer[] s_GetBatchesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetBatchesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessGetBatchesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/batches", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetBatchesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -364,18 +379,17 @@ partial void ProcessGetBatchesResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal Server Error if ((int)__response.StatusCode == 500) @@ -402,18 +416,17 @@ partial void ProcessGetBatchesResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -447,17 +460,15 @@ partial void ProcessGetBatchesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -494,17 +505,15 @@ partial void ProcessGetBatchesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs index e40ec7d7..2322f486 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class BatchesClient { + private static readonly global::Together.AutoSDKServer[] s_GetBatchesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetBatchesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessGetBatchesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/batches/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetBatchesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -377,18 +392,17 @@ partial void ProcessGetBatchesByIdResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -415,18 +429,17 @@ partial void ProcessGetBatchesByIdResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -453,18 +466,17 @@ partial void ProcessGetBatchesByIdResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Not Found if ((int)__response.StatusCode == 404) @@ -491,18 +503,17 @@ partial void ProcessGetBatchesByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal Server Error if ((int)__response.StatusCode == 500) @@ -529,18 +540,17 @@ partial void ProcessGetBatchesByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -574,17 +584,15 @@ partial void ProcessGetBatchesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -621,17 +629,15 @@ partial void ProcessGetBatchesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.BatchesClient.g.cs b/src/libs/Together/Generated/Together.BatchesClient.g.cs index 6e71aeb8..689ab127 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class BatchesClient : global::Together.IBatchesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the BatchesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs index f0800704..8d1d3e62 100644 --- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs @@ -8,6 +8,19 @@ namespace Together public partial class ChatClient { + private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ChatCompletionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -175,7 +188,9 @@ partial void ProcessChatCompletionsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/chat/completions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ChatCompletionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -426,18 +441,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -464,18 +478,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // NotFound if ((int)__response.StatusCode == 404) @@ -502,18 +515,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -540,18 +552,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Overloaded if ((int)__response.StatusCode == 503) @@ -578,18 +589,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_503 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Timeout if ((int)__response.StatusCode == 504) @@ -616,18 +626,17 @@ partial void ProcessChatCompletionsResponseContent( __exception_504 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, - statusCode: __response.StatusCode) - { - ResponseBody = __content_504, - ResponseObject = __value_504, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_504, + responseObject: __value_504, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -661,17 +670,15 @@ partial void ProcessChatCompletionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -708,17 +715,15 @@ partial void ProcessChatCompletionsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -781,7 +786,7 @@ partial void ProcessChatCompletionsResponseContent( /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -827,18 +832,18 @@ partial void ProcessChatCompletionsResponseContent( string model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default, double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.OneOf? functionCall = default, global::Together.ResponseFormat? responseFormat = default, diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs index 21d4104e..18d9d0f9 100644 --- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs @@ -8,6 +8,19 @@ namespace Together public partial class ChatClient { + private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsAsStreamServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ChatCompletionsAsStreamSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -131,7 +144,9 @@ partial void ProcessChatCompletionsAsStreamResponse( var __pathBuilder = new global::Together.PathBuilder( path: "/chat/completions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ChatCompletionsAsStreamServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -377,17 +392,15 @@ partial void ProcessChatCompletionsAsStreamResponse( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } using var __stream = await __response.Content.ReadAsStreamAsync( @@ -406,16 +419,15 @@ partial void ProcessChatCompletionsAsStreamResponse( } var __streamedResponse = global::Together.ChatCompletionStream.FromJson(__content, JsonSerializerContext) ?? - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: $"Response deserialization failed for \"{__content}\" ", - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + innerException: null, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); yield return __streamedResponse; } @@ -479,7 +491,7 @@ partial void ProcessChatCompletionsAsStreamResponse( /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -525,18 +537,18 @@ partial void ProcessChatCompletionsAsStreamResponse( string model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default, double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.OneOf? functionCall = default, global::Together.ResponseFormat? responseFormat = default, diff --git a/src/libs/Together/Generated/Together.ChatClient.g.cs b/src/libs/Together/Generated/Together.ChatClient.g.cs index 28d20481..bdbd3f57 100644 --- a/src/libs/Together/Generated/Together.ChatClient.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class ChatClient : global::Together.IChatClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class ChatClient : global::Together.IChatClient, global::S public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class ChatClient : global::Together.IChatClient, global::S public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the ChatClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs index f5d64711..40e54869 100644 --- a/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class CodeInterpreterClient { + private static readonly global::Together.AutoSDKServer[] s_SessionsListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SessionsListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessSessionsListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/tci/sessions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SessionsListServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -371,17 +386,15 @@ partial void ProcessSessionsListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -418,17 +431,15 @@ partial void ProcessSessionsListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs index c03fa6d7..8eacb182 100644 --- a/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class CodeInterpreterClient { + private static readonly global::Together.AutoSDKServer[] s_TciExecuteServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_TciExecuteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -139,7 +152,9 @@ partial void ProcessTciExecuteResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/tci/execute", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_TciExecuteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -397,17 +412,15 @@ partial void ProcessTciExecuteResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -444,17 +457,15 @@ partial void ProcessTciExecuteResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs index abbb1d1c..1e1ae65f 100644 --- a/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class CodeInterpreterClient : global::Together.ICodeInterpreterClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class CodeInterpreterClient : global::Together.ICodeInterp public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class CodeInterpreterClient : global::Together.ICodeInterp public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the CodeInterpreterClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs b/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs index bd5f62c4..9f61b4e9 100644 --- a/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs +++ b/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class CompletionClient { + private static readonly global::Together.AutoSDKServer[] s_CompletionsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CompletionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -160,7 +173,9 @@ partial void ProcessCompletionsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/completions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CompletionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -411,18 +426,17 @@ partial void ProcessCompletionsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -449,18 +463,17 @@ partial void ProcessCompletionsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // NotFound if ((int)__response.StatusCode == 404) @@ -487,18 +500,17 @@ partial void ProcessCompletionsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -525,18 +537,17 @@ partial void ProcessCompletionsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Overloaded if ((int)__response.StatusCode == 503) @@ -563,18 +574,17 @@ partial void ProcessCompletionsResponseContent( __exception_503 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Timeout if ((int)__response.StatusCode == 504) @@ -601,18 +611,17 @@ partial void ProcessCompletionsResponseContent( __exception_504 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, - statusCode: __response.StatusCode) - { - ResponseBody = __content_504, - ResponseObject = __value_504, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_504, + responseObject: __value_504, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -646,17 +655,15 @@ partial void ProcessCompletionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -693,17 +700,15 @@ partial void ProcessCompletionsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -768,7 +773,7 @@ partial void ProcessCompletionsResponseContent( /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -782,18 +787,18 @@ partial void ProcessCompletionsResponseContent( global::Together.AnyOf model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, - float? repetitionPenalty = default, + double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, global::Together.AnyOf? safetyModel = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) diff --git a/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs index e54366c2..00bccff5 100644 --- a/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class CompletionClient { + private static readonly global::Together.AutoSDKServer[] s_CompletionsAsStreamServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CompletionsAsStreamSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -118,7 +131,9 @@ partial void ProcessCompletionsAsStreamResponse( var __pathBuilder = new global::Together.PathBuilder( path: "/completions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CompletionsAsStreamServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -364,17 +379,15 @@ partial void ProcessCompletionsAsStreamResponse( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } using var __stream = await __response.Content.ReadAsStreamAsync( @@ -393,16 +406,15 @@ partial void ProcessCompletionsAsStreamResponse( } var __streamedResponse = global::Together.CompletionStream.FromJson(__content, JsonSerializerContext) ?? - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: $"Response deserialization failed for \"{__content}\" ", - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + innerException: null, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); yield return __streamedResponse; } @@ -468,7 +480,7 @@ partial void ProcessCompletionsAsStreamResponse( /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -482,18 +494,18 @@ partial void ProcessCompletionsAsStreamResponse( global::Together.AnyOf model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, - float? repetitionPenalty = default, + double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, global::Together.AnyOf? safetyModel = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) diff --git a/src/libs/Together/Generated/Together.CompletionClient.g.cs b/src/libs/Together/Generated/Together.CompletionClient.g.cs index a77b79cc..c5c5ae7f 100644 --- a/src/libs/Together/Generated/Together.CompletionClient.g.cs +++ b/src/libs/Together/Generated/Together.CompletionClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class CompletionClient : global::Together.ICompletionClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the CompletionClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs new file mode 100644 index 00000000..a79f2913 --- /dev/null +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class ConfigServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ConfigServiceGetProjectConfigServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ConfigServiceGetProjectConfigSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ConfigServiceGetProjectConfigSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ConfigServiceGetProjectConfigSecurityRequirement0, + }; + partial void PrepareConfigServiceGetProjectConfigArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareConfigServiceGetProjectConfigRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessConfigServiceGetProjectConfigResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessConfigServiceGetProjectConfigResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications. + ///
+ /// + /// Project identifier. + /// + /// + /// Config revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ConfigServiceGetProjectConfigAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ConfigServiceGetProjectConfigAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications. + ///
+ /// + /// Project identifier. + /// + /// + /// Config revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ConfigServiceGetProjectConfigAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareConfigServiceGetProjectConfigArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConfigServiceGetProjectConfigSecurityRequirements, + operationName: "ConfigServiceGetProjectConfigAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/configs/{id}", + baseUri: ResolveBaseUri( + servers: s_ConfigServiceGetProjectConfigServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConfigServiceGetProjectConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceGetProjectConfig", + methodName: "ConfigServiceGetProjectConfigAsync", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceGetProjectConfig", + methodName: "ConfigServiceGetProjectConfigAsync", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceGetProjectConfig", + methodName: "ConfigServiceGetProjectConfigAsync", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessConfigServiceGetProjectConfigResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceGetProjectConfig", + methodName: "ConfigServiceGetProjectConfigAsync", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceGetProjectConfig", + methodName: "ConfigServiceGetProjectConfigAsync", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessConfigServiceGetProjectConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeModelConfig.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeModelConfig.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs new file mode 100644 index 00000000..a1e2bcc4 --- /dev/null +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace Together +{ + public partial class ConfigServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ConfigServiceListProjectConfigsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ConfigServiceListProjectConfigsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ConfigServiceListProjectConfigsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ConfigServiceListProjectConfigsSecurityRequirement0, + }; + partial void PrepareConfigServiceListProjectConfigsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string? referenceModelId, + ref string? referenceModel, + ref int? limit, + ref string? after); + partial void PrepareConfigServiceListProjectConfigsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string? referenceModelId, + string? referenceModel, + int? limit, + string? after); + partial void ProcessConfigServiceListProjectConfigsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessConfigServiceListProjectConfigsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree. + /// + /// + /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ConfigServiceListProjectConfigsAsync( + string projectId, + string? referenceModelId = default, + string? referenceModel = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ConfigServiceListProjectConfigsAsResponseAsync( + projectId: projectId, + referenceModelId: referenceModelId, + referenceModel: referenceModel, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree. + /// + /// + /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ConfigServiceListProjectConfigsAsResponseAsync( + string projectId, + string? referenceModelId = default, + string? referenceModel = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareConfigServiceListProjectConfigsArguments( + httpClient: HttpClient, + projectId: ref projectId, + referenceModelId: ref referenceModelId, + referenceModel: ref referenceModel, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConfigServiceListProjectConfigsSecurityRequirements, + operationName: "ConfigServiceListProjectConfigsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/configs", + baseUri: ResolveBaseUri( + servers: s_ConfigServiceListProjectConfigsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("referenceModelId", referenceModelId) + .AddOptionalParameter("referenceModel", referenceModel) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConfigServiceListProjectConfigsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + referenceModelId: referenceModelId, + referenceModel: referenceModel, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceListProjectConfigs", + methodName: "ConfigServiceListProjectConfigsAsync", + pathTemplate: "$\"/projects/{projectId}/configs\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceListProjectConfigs", + methodName: "ConfigServiceListProjectConfigsAsync", + pathTemplate: "$\"/projects/{projectId}/configs\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceListProjectConfigs", + methodName: "ConfigServiceListProjectConfigsAsync", + pathTemplate: "$\"/projects/{projectId}/configs\"", + httpMethod: "GET", + 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::Together.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); + ProcessConfigServiceListProjectConfigsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceListProjectConfigs", + methodName: "ConfigServiceListProjectConfigsAsync", + pathTemplate: "$\"/projects/{projectId}/configs\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConfigServiceListProjectConfigs", + methodName: "ConfigServiceListProjectConfigsAsync", + pathTemplate: "$\"/projects/{projectId}/configs\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessConfigServiceListProjectConfigsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListProjectConfigsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListProjectConfigsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ConfigServiceClient.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs new file mode 100644 index 00000000..6a22909f --- /dev/null +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ConfigServiceClient : global::Together.IConfigServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ConfigServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ConfigServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ConfigServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ConfigServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ConfigServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ConfigServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs new file mode 100644 index 00000000..33a78f07 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs @@ -0,0 +1,573 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceAddAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceAddAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceAddAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceAddAdapterSecurityRequirement0, + }; + partial void PrepareDeploymentServiceAddAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string deploymentId, + global::Together.DeAddAdapterRequest request); + partial void PrepareDeploymentServiceAddAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string deploymentId, + global::Together.DeAddAdapterRequest request); + partial void ProcessDeploymentServiceAddAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceAddAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + + global::Together.DeAddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceAddAdapterAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceAddAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + + global::Together.DeAddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceAddAdapterArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + deploymentId: ref deploymentId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceAddAdapterSecurityRequirements, + operationName: "DeploymentServiceAddAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceAddAdapterServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceAddAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + deploymentId: deploymentId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceAddAdapter", + methodName: "DeploymentServiceAddAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceAddAdapter", + methodName: "DeploymentServiceAddAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceAddAdapter", + methodName: "DeploymentServiceAddAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + 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::Together.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); + ProcessDeploymentServiceAddAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceAddAdapter", + methodName: "DeploymentServiceAddAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceAddAdapter", + methodName: "DeploymentServiceAddAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceAddAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier to attach. + /// + /// + /// Optional adapter revision to pin. If omitted, the latest revision is resolved at request time. + /// + /// + /// Whether to evict the oldest adapter if the deployment is at adapter capacity. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string adapterModelId, + string? adapterRevisionId = default, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeAddAdapterRequest + { + AdapterModelId = adapterModelId, + AdapterRevisionId = adapterRevisionId, + Force = force, + }; + + return await DeploymentServiceAddAdapterAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs new file mode 100644 index 00000000..fe508302 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs @@ -0,0 +1,606 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceCreateDeploymentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceCreateDeploymentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceCreateDeploymentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceCreateDeploymentSecurityRequirement0, + }; + partial void PrepareDeploymentServiceCreateDeploymentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref bool? validateOnly, + global::Together.DeCreateDeploymentRequest request); + partial void PrepareDeploymentServiceCreateDeploymentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + bool? validateOnly, + global::Together.DeCreateDeploymentRequest request); + partial void ProcessDeploymentServiceCreateDeploymentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceCreateDeploymentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateDeploymentRequest request, + bool? validateOnly = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceCreateDeploymentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + + request: request, + validateOnly: validateOnly, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceCreateDeploymentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateDeploymentRequest request, + bool? validateOnly = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceCreateDeploymentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + validateOnly: ref validateOnly, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceCreateDeploymentSecurityRequirements, + operationName: "DeploymentServiceCreateDeploymentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceCreateDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("validateOnly", validateOnly?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceCreateDeploymentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + validateOnly: validateOnly, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceCreateDeployment", + methodName: "DeploymentServiceCreateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceCreateDeployment", + methodName: "DeploymentServiceCreateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceCreateDeployment", + methodName: "DeploymentServiceCreateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + 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::Together.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); + ProcessDeploymentServiceCreateDeploymentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceCreateDeployment", + methodName: "DeploymentServiceCreateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceCreateDeployment", + methodName: "DeploymentServiceCreateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceCreateDeploymentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string. + /// + /// + /// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset. + /// + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation. + /// + /// + /// Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset. + /// + /// + /// Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time. + /// + /// + /// Autoscaling configuration for the deployment. + /// + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model. + /// + /// + /// Enables dynamic loading of LoRA adapters on the deployment. + /// + /// + /// Placement policy to use when scheduling the deployment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( + string projectId, + string endpointId, + string name, + global::Together.DeAutoscaling autoscaling, + bool? validateOnly = default, + string? modelId = default, + string? modelRevisionId = default, + string? configId = default, + string? model = default, + string? config = default, + bool? enableLora = default, + global::Together.DePlacement? placement = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateDeploymentRequest + { + Name = name, + ModelId = modelId, + ModelRevisionId = modelRevisionId, + ConfigId = configId, + Model = model, + Autoscaling = autoscaling, + Config = config, + EnableLora = enableLora, + Placement = placement, + }; + + return await DeploymentServiceCreateDeploymentAsync( + projectId: projectId, + endpointId: endpointId, + validateOnly: validateOnly, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs new file mode 100644 index 00000000..48fe4afc --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs @@ -0,0 +1,519 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceDeleteDeploymentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceDeleteDeploymentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceDeleteDeploymentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceDeleteDeploymentSecurityRequirement0, + }; + partial void PrepareDeploymentServiceDeleteDeploymentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? etag); + partial void PrepareDeploymentServiceDeleteDeploymentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? etag); + partial void ProcessDeploymentServiceDeleteDeploymentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceDeleteDeploymentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceDeleteDeploymentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceDeleteDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceDeleteDeploymentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceDeleteDeploymentSecurityRequirements, + operationName: "DeploymentServiceDeleteDeploymentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceDeleteDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceDeleteDeploymentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceDeleteDeployment", + methodName: "DeploymentServiceDeleteDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceDeleteDeployment", + methodName: "DeploymentServiceDeleteDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceDeleteDeployment", + methodName: "DeploymentServiceDeleteDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessDeploymentServiceDeleteDeploymentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceDeleteDeployment", + methodName: "DeploymentServiceDeleteDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceDeleteDeployment", + methodName: "DeploymentServiceDeleteDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceDeleteDeploymentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs new file mode 100644 index 00000000..9d0e21df --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs @@ -0,0 +1,516 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceGetAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceGetAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceGetAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceGetAdapterSecurityRequirement0, + }; + partial void PrepareDeploymentServiceGetAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string deploymentId, + ref string id); + partial void PrepareDeploymentServiceGetAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string deploymentId, + string id); + partial void ProcessDeploymentServiceGetAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceGetAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceGetAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceGetAdapterAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceGetAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceGetAdapterArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + deploymentId: ref deploymentId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceGetAdapterSecurityRequirements, + operationName: "DeploymentServiceGetAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceGetAdapterServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceGetAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + deploymentId: deploymentId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetAdapter", + methodName: "DeploymentServiceGetAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetAdapter", + methodName: "DeploymentServiceGetAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetAdapter", + methodName: "DeploymentServiceGetAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessDeploymentServiceGetAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetAdapter", + methodName: "DeploymentServiceGetAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetAdapter", + methodName: "DeploymentServiceGetAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceGetAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs new file mode 100644 index 00000000..3b7c5723 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceGetDeploymentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceGetDeploymentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceGetDeploymentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceGetDeploymentSecurityRequirement0, + }; + partial void PrepareDeploymentServiceGetDeploymentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id); + partial void PrepareDeploymentServiceGetDeploymentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id); + partial void ProcessDeploymentServiceGetDeploymentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceGetDeploymentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceGetDeploymentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceGetDeploymentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceGetDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceGetDeploymentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceGetDeploymentSecurityRequirements, + operationName: "DeploymentServiceGetDeploymentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceGetDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceGetDeploymentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetDeployment", + methodName: "DeploymentServiceGetDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetDeployment", + methodName: "DeploymentServiceGetDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetDeployment", + methodName: "DeploymentServiceGetDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessDeploymentServiceGetDeploymentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetDeployment", + methodName: "DeploymentServiceGetDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceGetDeployment", + methodName: "DeploymentServiceGetDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceGetDeploymentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs new file mode 100644 index 00000000..ffc3a17e --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs @@ -0,0 +1,533 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceListAdaptersServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceListAdaptersSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceListAdaptersSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceListAdaptersSecurityRequirement0, + }; + partial void PrepareDeploymentServiceListAdaptersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string deploymentId, + ref int? limit, + ref string? after); + partial void PrepareDeploymentServiceListAdaptersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string deploymentId, + int? limit, + string? after); + partial void ProcessDeploymentServiceListAdaptersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceListAdaptersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Maximum number of adapters to return. + /// + /// + /// Cursor from a previous adapter list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceListAdaptersAsync( + string projectId, + string endpointId, + string deploymentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceListAdaptersAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Maximum number of adapters to return. + /// + /// + /// Cursor from a previous adapter list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceListAdaptersAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceListAdaptersArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + deploymentId: ref deploymentId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceListAdaptersSecurityRequirements, + operationName: "DeploymentServiceListAdaptersAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceListAdaptersServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceListAdaptersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + deploymentId: deploymentId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListAdapters", + methodName: "DeploymentServiceListAdaptersAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListAdapters", + methodName: "DeploymentServiceListAdaptersAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListAdapters", + methodName: "DeploymentServiceListAdaptersAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + httpMethod: "GET", + 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::Together.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); + ProcessDeploymentServiceListAdaptersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListAdapters", + methodName: "DeploymentServiceListAdaptersAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListAdapters", + methodName: "DeploymentServiceListAdaptersAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceListAdaptersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListAdaptersResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListAdaptersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs new file mode 100644 index 00000000..c343b5bf --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs @@ -0,0 +1,548 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceListDeploymentsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceListDeploymentsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceListDeploymentsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceListDeploymentsSecurityRequirement0, + }; + partial void PrepareDeploymentServiceListDeploymentsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref int? limit, + ref string? after, + ref string? orderBy, + ref string? filter); + partial void PrepareDeploymentServiceListDeploymentsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + int? limit, + string? after, + string? orderBy, + string? filter); + partial void ProcessDeploymentServiceListDeploymentsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceListDeploymentsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint whose deployments are listed. + /// + /// + /// Maximum number of deployments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous deployment list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_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 DeploymentServiceListDeploymentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceListDeploymentsAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint whose deployments are listed. + /// + /// + /// Maximum number of deployments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous deployment list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_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> DeploymentServiceListDeploymentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceListDeploymentsArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + limit: ref limit, + after: ref after, + orderBy: ref orderBy, + filter: ref filter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceListDeploymentsSecurityRequirements, + operationName: "DeploymentServiceListDeploymentsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceListDeploymentsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("orderBy", orderBy) + .AddOptionalParameter("filter", filter) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceListDeploymentsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListDeployments", + methodName: "DeploymentServiceListDeploymentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListDeployments", + methodName: "DeploymentServiceListDeploymentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListDeployments", + methodName: "DeploymentServiceListDeploymentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + httpMethod: "GET", + 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::Together.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); + ProcessDeploymentServiceListDeploymentsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListDeployments", + methodName: "DeploymentServiceListDeploymentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceListDeployments", + methodName: "DeploymentServiceListDeploymentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceListDeploymentsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListDeploymentsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListDeploymentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs new file mode 100644 index 00000000..38e946c9 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs @@ -0,0 +1,532 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceRemoveAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceRemoveAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceRemoveAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceRemoveAdapterSecurityRequirement0, + }; + partial void PrepareDeploymentServiceRemoveAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string deploymentId, + ref string id, + ref string etag); + partial void PrepareDeploymentServiceRemoveAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string deploymentId, + string id, + string etag); + partial void ProcessDeploymentServiceRemoveAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceRemoveAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceRemoveAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceRemoveAdapterAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceRemoveAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceRemoveAdapterArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + deploymentId: ref deploymentId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceRemoveAdapterSecurityRequirements, + operationName: "DeploymentServiceRemoveAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceRemoveAdapterServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddRequiredParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceRemoveAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + deploymentId: deploymentId!, + id: id!, + etag: etag!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceRemoveAdapter", + methodName: "DeploymentServiceRemoveAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceRemoveAdapter", + methodName: "DeploymentServiceRemoveAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceRemoveAdapter", + methodName: "DeploymentServiceRemoveAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessDeploymentServiceRemoveAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceRemoveAdapter", + methodName: "DeploymentServiceRemoveAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceRemoveAdapter", + methodName: "DeploymentServiceRemoveAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceRemoveAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs new file mode 100644 index 00000000..4ffab614 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs @@ -0,0 +1,586 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceUpdateAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceUpdateAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceUpdateAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceUpdateAdapterSecurityRequirement0, + }; + partial void PrepareDeploymentServiceUpdateAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string deploymentId, + ref string id, + global::Together.DeUpdateAdapterRequest request); + partial void PrepareDeploymentServiceUpdateAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string deploymentId, + string id, + global::Together.DeUpdateAdapterRequest request); + partial void ProcessDeploymentServiceUpdateAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceUpdateAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + + global::Together.DeUpdateAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceUpdateAdapterAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + + global::Together.DeUpdateAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceUpdateAdapterArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + deploymentId: ref deploymentId, + id: ref id, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceUpdateAdapterSecurityRequirements, + operationName: "DeploymentServiceUpdateAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceUpdateAdapterServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceUpdateAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + deploymentId: deploymentId!, + id: id!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateAdapter", + methodName: "DeploymentServiceUpdateAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateAdapter", + methodName: "DeploymentServiceUpdateAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateAdapter", + methodName: "DeploymentServiceUpdateAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessDeploymentServiceUpdateAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateAdapter", + methodName: "DeploymentServiceUpdateAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateAdapter", + methodName: "DeploymentServiceUpdateAdapterAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + httpMethod: "PATCH", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceUpdateAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// New adapter revision to pin. + /// + /// + /// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string adapterRevisionId, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateAdapterRequest + { + AdapterRevisionId = adapterRevisionId, + Etag = etag, + }; + + return await DeploymentServiceUpdateAdapterAsync( + projectId: projectId, + endpointId: endpointId, + deploymentId: deploymentId, + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs new file mode 100644 index 00000000..bedcd034 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs @@ -0,0 +1,594 @@ + +#nullable enable + +namespace Together +{ + public partial class DeploymentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceUpdateDeploymentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceUpdateDeploymentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceUpdateDeploymentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeploymentServiceUpdateDeploymentSecurityRequirement0, + }; + partial void PrepareDeploymentServiceUpdateDeploymentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? updateMask, + global::Together.DeUpdateDeploymentRequest request); + partial void PrepareDeploymentServiceUpdateDeploymentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? updateMask, + global::Together.DeUpdateDeploymentRequest request); + partial void ProcessDeploymentServiceUpdateDeploymentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateDeploymentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentServiceUpdateDeploymentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateDeploymentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeploymentServiceUpdateDeploymentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentServiceUpdateDeploymentSecurityRequirements, + operationName: "DeploymentServiceUpdateDeploymentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceUpdateDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentServiceUpdateDeploymentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + updateMask: updateMask, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateDeployment", + methodName: "DeploymentServiceUpdateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateDeployment", + methodName: "DeploymentServiceUpdateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateDeployment", + methodName: "DeploymentServiceUpdateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessDeploymentServiceUpdateDeploymentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateDeployment", + methodName: "DeploymentServiceUpdateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentServiceUpdateDeployment", + methodName: "DeploymentServiceUpdateDeploymentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + httpMethod: "PATCH", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessDeploymentServiceUpdateDeploymentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Updated endpoint string. + /// + /// + /// Updated autoscaling configuration. + /// + /// + /// Current deployment version. The update is rejected if this value no longer matches. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( + string projectId, + string endpointId, + string id, + string? updateMask = default, + string? name = default, + global::Together.DeAutoscaling? autoscaling = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateDeploymentRequest + { + Name = name, + Autoscaling = autoscaling, + Etag = etag, + }; + + return await DeploymentServiceUpdateDeploymentAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs new file mode 100644 index 00000000..ceb02179 --- /dev/null +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class DeploymentServiceClient : global::Together.IDeploymentServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the DeploymentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DeploymentServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DeploymentServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DeploymentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DeploymentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DeploymentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs index 6ab78bd7..2a345ecb 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateDeploymentsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -131,7 +144,9 @@ partial void ProcessCreateDeploymentsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,18 +397,17 @@ partial void ProcessCreateDeploymentsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -420,18 +434,17 @@ partial void ProcessCreateDeploymentsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -465,17 +478,15 @@ partial void ProcessCreateDeploymentsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -512,17 +523,15 @@ partial void ProcessCreateDeploymentsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs index cb0a43dc..abc8ed40 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteDeploymentsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -367,18 +382,17 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -405,18 +419,17 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -448,17 +461,15 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -493,17 +504,15 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs index a098243b..6845a2dc 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_EditDeploymentsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -135,7 +148,9 @@ partial void ProcessEditDeploymentsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -387,18 +402,17 @@ partial void ProcessEditDeploymentsByIdResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Deployment not found if ((int)__response.StatusCode == 404) @@ -425,18 +439,17 @@ partial void ProcessEditDeploymentsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -463,18 +476,17 @@ partial void ProcessEditDeploymentsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -508,17 +520,15 @@ partial void ProcessEditDeploymentsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -555,17 +565,15 @@ partial void ProcessEditDeploymentsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs index 8993303f..44df336f 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetDeploymentsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -354,18 +369,17 @@ partial void ProcessGetDeploymentsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -399,17 +413,15 @@ partial void ProcessGetDeploymentsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -446,17 +458,15 @@ partial void ProcessGetDeploymentsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs index a0091413..ea4a3bc5 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetDeploymentsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -367,18 +382,17 @@ partial void ProcessGetDeploymentsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -405,18 +419,17 @@ partial void ProcessGetDeploymentsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -450,17 +463,15 @@ partial void ProcessGetDeploymentsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -497,17 +508,15 @@ partial void ProcessGetDeploymentsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs index bb8e86a5..3f6667a1 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdLogsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsByIdLogsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -158,7 +171,9 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/{id}/logs", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdLogsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("replica_id", replicaId) .AddOptionalParameter("version", version) @@ -411,18 +426,17 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -449,18 +463,17 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -494,17 +507,15 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -541,17 +552,15 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.g.cs index a1ea3cb8..129370fc 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class DeploymentsClient : global::Together.IDeploymentsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsClient : global::Together.IDeploymentsCli public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class DeploymentsClient : global::Together.IDeploymentsCli public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the DeploymentsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs index a571a8c1..c7767e5d 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsStorageClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageByFilenameServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsStorageByFilenameSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -103,7 +116,9 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/storage/{filename}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageByFilenameServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -348,18 +363,17 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( __exception_307 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_307 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_307, - statusCode: __response.StatusCode) - { - ResponseBody = __content_307, - ResponseObject = __value_307, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_307, + responseObject: __value_307, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid request if ((int)__response.StatusCode == 400) @@ -386,18 +400,17 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( __exception_400 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // File not found if ((int)__response.StatusCode == 404) @@ -424,18 +437,17 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( __exception_404 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -462,18 +474,17 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( __exception_500 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -500,17 +511,15 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -538,17 +547,15 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs index 86c11b84..6e4b9579 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsStorageClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageByFilenameUrlServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsStorageByFilenameUrlSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/storage/{filename}/url", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageByFilenameUrlServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // File not found if ((int)__response.StatusCode == 404) @@ -393,18 +407,17 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -431,18 +444,17 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException>( + + throw global::Together.ApiException>.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -476,17 +488,15 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -523,17 +533,15 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs index 1bf7d25d..98332517 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class DeploymentsStorageClient : global::Together.IDeploymentsStorageClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsStorageClient : global::Together.IDeploym public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class DeploymentsStorageClient : global::Together.IDeploym public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the DeploymentsStorageClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs index 936b7a26..99dc6232 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsVolumesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsStorageVolumesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateDeploymentsStorageVolumesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -123,7 +136,9 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments/storage/volumes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsStorageVolumesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,18 +389,17 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -412,18 +426,17 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -457,17 +470,15 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -504,17 +515,15 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs index 4b0df238..8d92d17c 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsVolumesClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageVolumesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsStorageVolumesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments/storage/volumes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageVolumesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -354,18 +369,17 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -399,17 +413,15 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -446,17 +458,15 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs index 4c565567..87c1f457 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class DeploymentsVolumesClient : global::Together.IDeploymentsVolumesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsVolumesClient : global::Together.IDeploym public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class DeploymentsVolumesClient : global::Together.IDeploym public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the DeploymentsVolumesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs b/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs index 5b2c3956..23d14c9f 100644 --- a/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs +++ b/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EmbeddingsClient { + private static readonly global::Together.AutoSDKServer[] s_EmbeddingsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_EmbeddingsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -137,7 +150,9 @@ partial void ProcessEmbeddingsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/embeddings", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_EmbeddingsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -388,18 +403,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -426,18 +440,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // NotFound if ((int)__response.StatusCode == 404) @@ -464,18 +477,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -502,18 +514,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Overloaded if ((int)__response.StatusCode == 503) @@ -540,18 +551,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_503 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Timeout if ((int)__response.StatusCode == 504) @@ -578,18 +588,17 @@ partial void ProcessEmbeddingsResponseContent( __exception_504 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, - statusCode: __response.StatusCode) - { - ResponseBody = __content_504, - ResponseObject = __value_504, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_504, + responseObject: __value_504, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -623,17 +632,15 @@ partial void ProcessEmbeddingsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -670,17 +677,15 @@ partial void ProcessEmbeddingsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs b/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs index 1eea3b48..9443663f 100644 --- a/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs +++ b/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClien public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClien public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the EmbeddingsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs new file mode 100644 index 00000000..bdb5c2e2 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs @@ -0,0 +1,533 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceCreateEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceCreateEndpointSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceCreateEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceCreateEndpointSecurityRequirement0, + }; + partial void PrepareEndpointServiceCreateEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + global::Together.DeCreateEndpointRequest request); + partial void PrepareEndpointServiceCreateEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + global::Together.DeCreateEndpointRequest request); + partial void ProcessEndpointServiceCreateEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceCreateEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( + string projectId, + + global::Together.DeCreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceCreateEndpointAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceCreateEndpointAsResponseAsync( + string projectId, + + global::Together.DeCreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceCreateEndpointArguments( + httpClient: HttpClient, + projectId: ref projectId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceCreateEndpointSecurityRequirements, + operationName: "EndpointServiceCreateEndpointAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceCreateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceCreateEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceCreateEndpoint", + methodName: "EndpointServiceCreateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceCreateEndpoint", + methodName: "EndpointServiceCreateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceCreateEndpoint", + methodName: "EndpointServiceCreateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + 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::Together.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); + ProcessEndpointServiceCreateEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceCreateEndpoint", + methodName: "EndpointServiceCreateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceCreateEndpoint", + methodName: "EndpointServiceCreateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceCreateEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeEndpoint.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeEndpoint.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Inference-addressable endpoint name to create. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( + string projectId, + string name, + global::Together.DeCreateEndpointRequestVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateEndpointRequest + { + Name = name, + Visibility = visibility, + }; + + return await EndpointServiceCreateEndpointAsync( + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs new file mode 100644 index 00000000..36608cb6 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs @@ -0,0 +1,506 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceDeleteEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceDeleteEndpointSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceDeleteEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceDeleteEndpointSecurityRequirement0, + }; + partial void PrepareEndpointServiceDeleteEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string? etag); + partial void PrepareEndpointServiceDeleteEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string? etag); + partial void ProcessEndpointServiceDeleteEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceDeleteEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete an endpoint
+ /// Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceDeleteEndpointAsync( + string projectId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceDeleteEndpointAsResponseAsync( + projectId: projectId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete an endpoint
+ /// Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceDeleteEndpointAsResponseAsync( + string projectId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceDeleteEndpointArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceDeleteEndpointSecurityRequirements, + operationName: "EndpointServiceDeleteEndpointAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceDeleteEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceDeleteEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceDeleteEndpoint", + methodName: "EndpointServiceDeleteEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceDeleteEndpoint", + methodName: "EndpointServiceDeleteEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceDeleteEndpoint", + methodName: "EndpointServiceDeleteEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessEndpointServiceDeleteEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceDeleteEndpoint", + methodName: "EndpointServiceDeleteEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceDeleteEndpoint", + methodName: "EndpointServiceDeleteEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceDeleteEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs new file mode 100644 index 00000000..c05d4979 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceGetEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceGetEndpointSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceGetEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceGetEndpointSecurityRequirement0, + }; + partial void PrepareEndpointServiceGetEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareEndpointServiceGetEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessEndpointServiceGetEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceGetEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get an endpoint
+ /// Retrieves an endpoint and lightweight summaries of the deployments attached to it. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceGetEndpointAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceGetEndpointAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an endpoint
+ /// Retrieves an endpoint and lightweight summaries of the deployments attached to it. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceGetEndpointArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceGetEndpointSecurityRequirements, + operationName: "EndpointServiceGetEndpointAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceGetEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceGetEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpoint", + methodName: "EndpointServiceGetEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpoint", + methodName: "EndpointServiceGetEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpoint", + methodName: "EndpointServiceGetEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceGetEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpoint", + methodName: "EndpointServiceGetEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpoint", + methodName: "EndpointServiceGetEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceGetEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeEndpoint.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeEndpoint.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs new file mode 100644 index 00000000..7e5dedb8 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs @@ -0,0 +1,562 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceGetEndpointAnalyticsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceGetEndpointAnalyticsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceGetEndpointAnalyticsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceGetEndpointAnalyticsSecurityRequirement0, + }; + partial void PrepareEndpointServiceGetEndpointAnalyticsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string? deploymentId, + ref global::System.DateTime? startTime, + ref global::System.DateTime? endTime, + ref bool? includeTimeSeries, + ref string? granularity); + partial void PrepareEndpointServiceGetEndpointAnalyticsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string? deploymentId, + global::System.DateTime? startTime, + global::System.DateTime? endTime, + bool? includeTimeSeries, + string? granularity); + partial void ProcessEndpointServiceGetEndpointAnalyticsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get endpoint analytics
+ /// Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Restrict to a single deployment under this endpoint. + /// + /// + /// Inclusive start of the time range. Defaults to 24 hours ago if unset. + /// + /// + /// Exclusive end of the time range. Defaults to now if unset. + /// + /// + /// When true, include per-bucket time series in the response. + /// + /// + /// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceGetEndpointAnalyticsAsync( + string projectId, + string id, + string? deploymentId = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + bool? includeTimeSeries = default, + string? granularity = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceGetEndpointAnalyticsAsResponseAsync( + projectId: projectId, + id: id, + deploymentId: deploymentId, + startTime: startTime, + endTime: endTime, + includeTimeSeries: includeTimeSeries, + granularity: granularity, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get endpoint analytics
+ /// Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Restrict to a single deployment under this endpoint. + /// + /// + /// Inclusive start of the time range. Defaults to 24 hours ago if unset. + /// + /// + /// Exclusive end of the time range. Defaults to now if unset. + /// + /// + /// When true, include per-bucket time series in the response. + /// + /// + /// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAnalyticsAsResponseAsync( + string projectId, + string id, + string? deploymentId = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + bool? includeTimeSeries = default, + string? granularity = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceGetEndpointAnalyticsArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + deploymentId: ref deploymentId, + startTime: ref startTime, + endTime: ref endTime, + includeTimeSeries: ref includeTimeSeries, + granularity: ref granularity); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceGetEndpointAnalyticsSecurityRequirements, + operationName: "EndpointServiceGetEndpointAnalyticsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{id}/analytics", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceGetEndpointAnalyticsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("deploymentId", deploymentId) + .AddOptionalParameter("startTime", startTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("endTime", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("includeTimeSeries", includeTimeSeries?.ToString().ToLowerInvariant()) + .AddOptionalParameter("granularity", granularity) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceGetEndpointAnalyticsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + deploymentId: deploymentId, + startTime: startTime, + endTime: endTime, + includeTimeSeries: includeTimeSeries, + granularity: granularity); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpointAnalytics", + methodName: "EndpointServiceGetEndpointAnalyticsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpointAnalytics", + methodName: "EndpointServiceGetEndpointAnalyticsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpointAnalytics", + methodName: "EndpointServiceGetEndpointAnalyticsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceGetEndpointAnalyticsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpointAnalytics", + methodName: "EndpointServiceGetEndpointAnalyticsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceGetEndpointAnalytics", + methodName: "EndpointServiceGetEndpointAnalyticsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceGetEndpointAnalyticsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeAnalyticsData.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeAnalyticsData.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs new file mode 100644 index 00000000..c8a8882d --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs @@ -0,0 +1,618 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListEndpointEventsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceListEndpointEventsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceListEndpointEventsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceListEndpointEventsSecurityRequirement0, + }; + partial void PrepareEndpointServiceListEndpointEventsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref int? limit, + ref string? after, + global::System.Collections.Generic.IList? types, + ref global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel, + ref global::System.DateTime? since, + ref global::System.DateTime? until, + global::System.Collections.Generic.IList? deploymentIds, + global::System.Collections.Generic.IList? sourceKinds, + ref string? subjectId); + partial void PrepareEndpointServiceListEndpointEventsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + int? limit, + string? after, + global::System.Collections.Generic.IList? types, + global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel, + global::System.DateTime? since, + global::System.DateTime? until, + global::System.Collections.Generic.IList? deploymentIds, + global::System.Collections.Generic.IList? sourceKinds, + string? subjectId); + partial void ProcessEndpointServiceListEndpointEventsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceListEndpointEventsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List endpoint events
+ /// Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of events to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous endpoint event list response. + /// + /// + /// Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND. + /// + /// + /// Minimum severity. Omit to disable severity filtering. + /// + /// + /// Return only events at or after this time. + /// + /// + /// Return only events strictly before this time. + /// + /// + /// Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`. + /// + /// + /// Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events. + /// + /// + /// ID of a subject associated with the event, such as a rollout. Combined with other filters using AND. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceListEndpointEventsAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::System.Collections.Generic.IList? types = default, + global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel = default, + global::System.DateTime? since = default, + global::System.DateTime? until = default, + global::System.Collections.Generic.IList? deploymentIds = default, + global::System.Collections.Generic.IList? sourceKinds = default, + string? subjectId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceListEndpointEventsAsResponseAsync( + projectId: projectId, + id: id, + limit: limit, + after: after, + types: types, + minLevel: minLevel, + since: since, + until: until, + deploymentIds: deploymentIds, + sourceKinds: sourceKinds, + subjectId: subjectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List endpoint events
+ /// Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of events to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous endpoint event list response. + /// + /// + /// Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND. + /// + /// + /// Minimum severity. Omit to disable severity filtering. + /// + /// + /// Return only events at or after this time. + /// + /// + /// Return only events strictly before this time. + /// + /// + /// Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`. + /// + /// + /// Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events. + /// + /// + /// ID of a subject associated with the event, such as a rollout. Combined with other filters using AND. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceListEndpointEventsAsResponseAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::System.Collections.Generic.IList? types = default, + global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel = default, + global::System.DateTime? since = default, + global::System.DateTime? until = default, + global::System.Collections.Generic.IList? deploymentIds = default, + global::System.Collections.Generic.IList? sourceKinds = default, + string? subjectId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceListEndpointEventsArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + limit: ref limit, + after: ref after, + types: types, + minLevel: ref minLevel, + since: ref since, + until: ref until, + deploymentIds: deploymentIds, + sourceKinds: sourceKinds, + subjectId: ref subjectId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceListEndpointEventsSecurityRequirements, + operationName: "EndpointServiceListEndpointEventsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{id}/events", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListEndpointEventsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("types", types, delimiter: ",", explode: true) + .AddOptionalParameter("minLevel", minLevel?.ToValueString()) + .AddOptionalParameter("since", since?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("until", until?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("deploymentIds", deploymentIds, delimiter: ",", explode: true) + .AddOptionalParameter("sourceKinds", sourceKinds, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("subjectId", subjectId) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceListEndpointEventsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + limit: limit, + after: after, + types: types, + minLevel: minLevel, + since: since, + until: until, + deploymentIds: deploymentIds, + sourceKinds: sourceKinds, + subjectId: subjectId); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpointEvents", + methodName: "EndpointServiceListEndpointEventsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpointEvents", + methodName: "EndpointServiceListEndpointEventsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpointEvents", + methodName: "EndpointServiceListEndpointEventsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceListEndpointEventsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpointEvents", + methodName: "EndpointServiceListEndpointEventsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpointEvents", + methodName: "EndpointServiceListEndpointEventsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceListEndpointEventsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListEndpointEventsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListEndpointEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs new file mode 100644 index 00000000..12f5af71 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs @@ -0,0 +1,537 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListEndpointsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceListEndpointsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceListEndpointsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceListEndpointsSecurityRequirement0, + }; + partial void PrepareEndpointServiceListEndpointsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref int? limit, + ref string? after, + ref string? orderBy, + ref string? filter); + partial void PrepareEndpointServiceListEndpointsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + int? limit, + string? after, + string? orderBy, + string? filter); + partial void ProcessEndpointServiceListEndpointsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceListEndpointsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List endpoints
+ /// Lists the dedicated inference endpoints owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of endpoints to return.
+ /// Default Value: 50 + /// + /// + /// Cursor from a previous response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `<project_slug>/<endpoint_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 EndpointServiceListEndpointsAsync( + string projectId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceListEndpointsAsResponseAsync( + projectId: projectId, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List endpoints
+ /// Lists the dedicated inference endpoints owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of endpoints to return.
+ /// Default Value: 50 + /// + /// + /// Cursor from a previous response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `<project_slug>/<endpoint_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> EndpointServiceListEndpointsAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceListEndpointsArguments( + httpClient: HttpClient, + projectId: ref projectId, + limit: ref limit, + after: ref after, + orderBy: ref orderBy, + filter: ref filter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceListEndpointsSecurityRequirements, + operationName: "EndpointServiceListEndpointsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("orderBy", orderBy) + .AddOptionalParameter("filter", filter) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceListEndpointsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpoints", + methodName: "EndpointServiceListEndpointsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpoints", + methodName: "EndpointServiceListEndpointsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpoints", + methodName: "EndpointServiceListEndpointsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceListEndpointsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpoints", + methodName: "EndpointServiceListEndpointsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListEndpoints", + methodName: "EndpointServiceListEndpointsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceListEndpointsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListEndpointsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListEndpointsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs new file mode 100644 index 00000000..a662c6f6 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListOrganizationEndpointsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceListOrganizationEndpointsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceListOrganizationEndpointsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceListOrganizationEndpointsSecurityRequirement0, + }; + partial void PrepareEndpointServiceListOrganizationEndpointsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string organizationId, + ref int? limit, + ref string? after, + ref string? orderBy, + ref string? filter); + partial void PrepareEndpointServiceListOrganizationEndpointsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string organizationId, + int? limit, + string? after, + string? orderBy, + string? filter); + partial void ProcessEndpointServiceListOrganizationEndpointsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List organization endpoints
+ /// Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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 EndpointServiceListOrganizationEndpointsAsync( + string organizationId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceListOrganizationEndpointsAsResponseAsync( + organizationId: organizationId, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List organization endpoints
+ /// Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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> EndpointServiceListOrganizationEndpointsAsResponseAsync( + string organizationId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceListOrganizationEndpointsArguments( + httpClient: HttpClient, + organizationId: ref organizationId, + limit: ref limit, + after: ref after, + orderBy: ref orderBy, + filter: ref filter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceListOrganizationEndpointsSecurityRequirements, + operationName: "EndpointServiceListOrganizationEndpointsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/organizations/{organizationId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListOrganizationEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("orderBy", orderBy) + .AddOptionalParameter("filter", filter) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceListOrganizationEndpointsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListOrganizationEndpoints", + methodName: "EndpointServiceListOrganizationEndpointsAsync", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListOrganizationEndpoints", + methodName: "EndpointServiceListOrganizationEndpointsAsync", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListOrganizationEndpoints", + methodName: "EndpointServiceListOrganizationEndpointsAsync", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceListOrganizationEndpointsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListOrganizationEndpoints", + methodName: "EndpointServiceListOrganizationEndpointsAsync", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListOrganizationEndpoints", + methodName: "EndpointServiceListOrganizationEndpointsAsync", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceListOrganizationEndpointsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListEndpointsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListEndpointsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs new file mode 100644 index 00000000..54c2a0e7 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs @@ -0,0 +1,522 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListPublicEndpointsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceListPublicEndpointsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceListPublicEndpointsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceListPublicEndpointsSecurityRequirement0, + }; + partial void PrepareEndpointServiceListPublicEndpointsArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? limit, + ref string? after, + ref string? orderBy, + ref string? filter); + partial void PrepareEndpointServiceListPublicEndpointsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? limit, + string? after, + string? orderBy, + string? filter); + partial void ProcessEndpointServiceListPublicEndpointsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceListPublicEndpointsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List public endpoints
+ /// Lists endpoints that are publicly visible across Together projects. + ///
+ /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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 EndpointServiceListPublicEndpointsAsync( + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceListPublicEndpointsAsResponseAsync( + limit: limit, + after: after, + orderBy: orderBy, + filter: filter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List public endpoints
+ /// Lists endpoints that are publicly visible across Together projects. + ///
+ /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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> EndpointServiceListPublicEndpointsAsResponseAsync( + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceListPublicEndpointsArguments( + httpClient: HttpClient, + limit: ref limit, + after: ref after, + orderBy: ref orderBy, + filter: ref filter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceListPublicEndpointsSecurityRequirements, + operationName: "EndpointServiceListPublicEndpointsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/public/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListPublicEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("orderBy", orderBy) + .AddOptionalParameter("filter", filter) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceListPublicEndpointsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + limit: limit, + after: after, + orderBy: orderBy, + filter: filter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListPublicEndpoints", + methodName: "EndpointServiceListPublicEndpointsAsync", + pathTemplate: "\"/public/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListPublicEndpoints", + methodName: "EndpointServiceListPublicEndpointsAsync", + pathTemplate: "\"/public/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListPublicEndpoints", + methodName: "EndpointServiceListPublicEndpointsAsync", + pathTemplate: "\"/public/endpoints\"", + httpMethod: "GET", + 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::Together.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); + ProcessEndpointServiceListPublicEndpointsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListPublicEndpoints", + methodName: "EndpointServiceListPublicEndpointsAsync", + pathTemplate: "\"/public/endpoints\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceListPublicEndpoints", + methodName: "EndpointServiceListPublicEndpointsAsync", + pathTemplate: "\"/public/endpoints\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceListPublicEndpointsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListPublicEndpointsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListPublicEndpointsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs new file mode 100644 index 00000000..f481f050 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs @@ -0,0 +1,582 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceUpdateEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EndpointServiceUpdateEndpointSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EndpointServiceUpdateEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EndpointServiceUpdateEndpointSecurityRequirement0, + }; + partial void PrepareEndpointServiceUpdateEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string? updateMask, + global::Together.DeEndpointUpdate request); + partial void PrepareEndpointServiceUpdateEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string? updateMask, + global::Together.DeEndpointUpdate request); + partial void ProcessEndpointServiceUpdateEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEndpointServiceUpdateEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( + string projectId, + string id, + + global::Together.DeEndpointUpdate request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EndpointServiceUpdateEndpointAsResponseAsync( + projectId: projectId, + id: id, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EndpointServiceUpdateEndpointAsResponseAsync( + string projectId, + string id, + + global::Together.DeEndpointUpdate request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEndpointServiceUpdateEndpointArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EndpointServiceUpdateEndpointSecurityRequirements, + operationName: "EndpointServiceUpdateEndpointAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceUpdateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEndpointServiceUpdateEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + updateMask: updateMask, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceUpdateEndpoint", + methodName: "EndpointServiceUpdateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceUpdateEndpoint", + methodName: "EndpointServiceUpdateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceUpdateEndpoint", + methodName: "EndpointServiceUpdateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessEndpointServiceUpdateEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceUpdateEndpoint", + methodName: "EndpointServiceUpdateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EndpointServiceUpdateEndpoint", + methodName: "EndpointServiceUpdateEndpointAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", + httpMethod: "PATCH", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEndpointServiceUpdateEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeEndpoint.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeEndpoint.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Updated endpoint string. + /// + /// + /// Current endpoint version. The update is rejected if this value no longer matches. + /// + /// + /// Replacement live traffic split. Use an empty list to stop routing live traffic. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( + string projectId, + string id, + string? updateMask = default, + string? name = default, + string? etag = default, + global::System.Collections.Generic.IList? trafficSplit = default, + global::Together.DeEndpointUpdateVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeEndpointUpdate + { + Name = name, + Etag = etag, + TrafficSplit = trafficSplit, + Visibility = visibility, + }; + + return await EndpointServiceUpdateEndpointAsync( + projectId: projectId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs new file mode 100644 index 00000000..aa736916 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class EndpointServiceClient : global::Together.IEndpointServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the EndpointServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EndpointServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the EndpointServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EndpointServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the EndpointServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EndpointServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs b/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs index 08d2e821..fb4d92e2 100644 --- a/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs +++ b/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class Endpoints2Client { + private static readonly global::Together.AutoSDKServer[] s_AvailabilityZonesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_AvailabilityZonesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -116,7 +129,9 @@ partial void ProcessAvailabilityZonesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/clusters/availability-zones", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_AvailabilityZonesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -367,17 +382,15 @@ partial void ProcessAvailabilityZonesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -414,17 +427,15 @@ partial void ProcessAvailabilityZonesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.Endpoints2Client.g.cs b/src/libs/Together/Generated/Together.Endpoints2Client.g.cs index 04ddb933..d68214a1 100644 --- a/src/libs/Together/Generated/Together.Endpoints2Client.g.cs +++ b/src/libs/Together/Generated/Together.Endpoints2Client.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class Endpoints2Client : global::Together.IEndpoints2Client, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class Endpoints2Client : global::Together.IEndpoints2Clien public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class Endpoints2Client : global::Together.IEndpoints2Clien public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the Endpoints2Client. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs new file mode 100644 index 00000000..e800fe7b --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs @@ -0,0 +1,637 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_AddAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_AddAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_AddAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_AddAdapterSecurityRequirement0, + }; + partial void PrepareAddAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId, + global::Together.AddAdapterRequest request); + partial void PrepareAddAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId, + global::Together.AddAdapterRequest request); + partial void ProcessAddAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAddAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ public async global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddAdapterAsResponseAsync( + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ public async global::System.Threading.Tasks.Task> AddAdapterAsResponseAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAddAdapterArguments( + httpClient: HttpClient, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AddAdapterSecurityRequirements, + operationName: "AddAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_AddAdapterServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAddAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + 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::Together.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); + ProcessAddAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + 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); + } + // Bad Request — invalid model_id format, endpoint name mismatch, LoRA not enabled, incompatible base model, or adapter already bound + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Forbidden — adapter model not found or not owned + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessAddAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.AddAdapterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.AddAdapterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.AddAdapterRequest + { + ModelId = modelId, + }; + + return await AddAdapterAsync( + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs index 8e429340..c9076dcd 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs @@ -8,6 +8,19 @@ namespace Together public partial class EndpointsClient { + private static readonly global::Together.AutoSDKServer[] s_CreateEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -147,7 +160,9 @@ partial void ProcessCreateEndpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/endpoints", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -398,18 +413,17 @@ partial void ProcessCreateEndpointResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -436,18 +450,17 @@ partial void ProcessCreateEndpointResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -481,17 +494,15 @@ partial void ProcessCreateEndpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -528,17 +539,15 @@ partial void ProcessCreateEndpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs index 5b1076d1..13adb047 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EndpointsClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -125,7 +138,9 @@ await DeleteEndpointAsResponseAsync( var __pathBuilder = new global::Together.PathBuilder( path: $"/endpoints/{endpointId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteEndpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -370,18 +385,17 @@ await DeleteEndpointAsResponseAsync( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Not Found if ((int)__response.StatusCode == 404) @@ -408,18 +422,17 @@ await DeleteEndpointAsResponseAsync( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -446,18 +459,17 @@ await DeleteEndpointAsResponseAsync( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -484,17 +496,15 @@ await DeleteEndpointAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -522,17 +532,15 @@ await DeleteEndpointAsResponseAsync( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs index f65fb507..cacec4f5 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EndpointsClient { + private static readonly global::Together.AutoSDKServer[] s_GetEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessGetEndpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/endpoints/{endpointId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetEndpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -377,18 +392,17 @@ partial void ProcessGetEndpointResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Not Found if ((int)__response.StatusCode == 404) @@ -415,18 +429,17 @@ partial void ProcessGetEndpointResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -453,18 +466,17 @@ partial void ProcessGetEndpointResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -498,17 +510,15 @@ partial void ProcessGetEndpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -545,17 +555,15 @@ partial void ProcessGetEndpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs new file mode 100644 index 00000000..79bd491d --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs @@ -0,0 +1,498 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListAdaptersServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ListAdaptersSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ListAdaptersSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListAdaptersSecurityRequirement0, + }; + partial void PrepareListAdaptersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId); + partial void PrepareListAdaptersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId); + partial void ProcessListAdaptersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListAdaptersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("endpoint-abc123")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ public async global::System.Threading.Tasks.Task ListAdaptersAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAdaptersAsResponseAsync( + endpointId: endpointId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("endpoint-abc123")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ public async global::System.Threading.Tasks.Task> ListAdaptersAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListAdaptersArguments( + httpClient: HttpClient, + endpointId: ref endpointId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListAdaptersSecurityRequirements, + operationName: "ListAdaptersAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_ListAdaptersServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListAdaptersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + 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::Together.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); + ProcessListAdaptersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + 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); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessListAdaptersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListAdaptersResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.ListAdaptersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs index df4beb62..03fa9cbe 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EndpointsClient { + private static readonly global::Together.AutoSDKServer[] s_ListEndpointsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ListEndpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -156,7 +169,9 @@ partial void ProcessListEndpointsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/endpoints", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ListEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("type", type?.ToValueString()) .AddOptionalParameter("usage_type", usageType?.ToValueString()) @@ -408,18 +423,17 @@ partial void ProcessListEndpointsResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -446,18 +460,17 @@ partial void ProcessListEndpointsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -491,17 +504,15 @@ partial void ProcessListEndpointsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -538,17 +549,15 @@ partial void ProcessListEndpointsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs new file mode 100644 index 00000000..5d2d9463 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs @@ -0,0 +1,625 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_RemoveAdapterServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RemoveAdapterSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RemoveAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RemoveAdapterSecurityRequirement0, + }; + partial void PrepareRemoveAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId, + global::Together.RemoveAdapterRequest request); + partial void PrepareRemoveAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId, + global::Together.RemoveAdapterRequest request); + partial void ProcessRemoveAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRemoveAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ public async global::System.Threading.Tasks.Task RemoveAdapterAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RemoveAdapterAsResponseAsync( + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ public async global::System.Threading.Tasks.Task> RemoveAdapterAsResponseAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRemoveAdapterArguments( + httpClient: HttpClient, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RemoveAdapterSecurityRequirements, + operationName: "RemoveAdapterAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_RemoveAdapterServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRemoveAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessRemoveAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + 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); + } + // Bad Request — invalid model_id format, or adapter not bound to this endpoint + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Forbidden — adapter model not found or not owned + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessRemoveAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RemoveAdapterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RemoveAdapterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_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 RemoveAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RemoveAdapterRequest + { + ModelId = modelId, + }; + + return await RemoveAdapterAsync( + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs index f81b2956..72bb7e0a 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EndpointsClient { + private static readonly global::Together.AutoSDKServer[] s_UpdateEndpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_UpdateEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -151,7 +164,9 @@ partial void ProcessUpdateEndpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/endpoints/{endpointId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_UpdateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -403,18 +418,17 @@ partial void ProcessUpdateEndpointResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Not Found if ((int)__response.StatusCode == 404) @@ -441,18 +455,17 @@ partial void ProcessUpdateEndpointResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -479,18 +492,17 @@ partial void ProcessUpdateEndpointResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -524,17 +536,15 @@ partial void ProcessUpdateEndpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -571,17 +581,15 @@ partial void ProcessUpdateEndpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EndpointsClient.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.g.cs index 88eb59f3..e1a7ec34 100644 --- a/src/libs/Together/Generated/Together.EndpointsClient.g.cs +++ b/src/libs/Together/Generated/Together.EndpointsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class EndpointsClient : global::Together.IEndpointsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class EndpointsClient : global::Together.IEndpointsClient, public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class EndpointsClient : global::Together.IEndpointsClient, public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the EndpointsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs index aefc69fc..af670aff 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_CreateEvaluationJobServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateEvaluationJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -155,7 +168,9 @@ partial void ProcessCreateEvaluationJobResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/evaluation", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateEvaluationJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -406,18 +421,17 @@ partial void ProcessCreateEvaluationJobResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Failed to create evaluation job if ((int)__response.StatusCode == 500) @@ -444,18 +458,17 @@ partial void ProcessCreateEvaluationJobResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -489,17 +502,15 @@ partial void ProcessCreateEvaluationJobResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -536,17 +547,15 @@ partial void ProcessCreateEvaluationJobResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs index 9228b947..1fe7b0b9 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetAllEvaluationJobsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetAllEvaluationJobsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -144,7 +157,9 @@ partial void ProcessGetAllEvaluationJobsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/evaluation", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetAllEvaluationJobsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("status", status) .AddOptionalParameter("limit", limit?.ToString()) @@ -394,18 +409,17 @@ partial void ProcessGetAllEvaluationJobsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Error retrieving jobs from manager if ((int)__response.StatusCode == 500) @@ -432,18 +446,17 @@ partial void ProcessGetAllEvaluationJobsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -477,17 +490,15 @@ partial void ProcessGetAllEvaluationJobsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -524,17 +535,15 @@ partial void ProcessGetAllEvaluationJobsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs index 014cc8d9..e4b17216 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetEvaluationJobDetailsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetEvaluationJobDetailsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -128,7 +141,9 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/evaluation/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetEvaluationJobDetailsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -373,18 +388,17 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Failed to get evaluation job if ((int)__response.StatusCode == 500) @@ -411,18 +425,17 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -456,17 +469,15 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -503,17 +514,15 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs index d2945d60..9d16f219 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetEvaluationJobStatusAndResultsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetEvaluationJobStatusAndResultsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/evaluation/{id}/status", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetEvaluationJobStatusAndResultsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -375,18 +390,17 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Failed to get evaluation job if ((int)__response.StatusCode == 500) @@ -413,18 +427,17 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -458,17 +471,15 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -505,17 +516,15 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs index f062d9d8..9ef0f70c 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetModelListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetModelListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetModelListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/evaluation/model-list", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetModelListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("model_source", modelSource) ; @@ -358,18 +373,17 @@ partial void ProcessGetModelListResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Error retrieving model list if ((int)__response.StatusCode == 500) @@ -396,18 +410,17 @@ partial void ProcessGetModelListResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -441,17 +454,15 @@ partial void ProcessGetModelListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -488,17 +499,15 @@ partial void ProcessGetModelListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.g.cs index 7c0193bd..9d458181 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class EvaluationClient : global::Together.IEvaluationClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class EvaluationClient : global::Together.IEvaluationClien public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class EvaluationClient : global::Together.IEvaluationClien public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the EvaluationClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Exceptions.g.cs b/src/libs/Together/Generated/Together.Exceptions.g.cs index a97e4ab1..63c2870f 100644 --- a/src/libs/Together/Generated/Together.Exceptions.g.cs +++ b/src/libs/Together/Generated/Together.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. /// public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::Together.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Together.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Together.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Together.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::Together.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Together.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Together.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Together.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs b/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs index fb535979..172cf6c8 100644 --- a/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFilesUploadServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateFilesUploadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -135,7 +148,9 @@ partial void ProcessCreateFilesUploadResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/files/upload", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -413,6 +428,43 @@ request.FileName is null retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // Internal Server Error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.ErrorData? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // Bad Request if ((int)__response.StatusCode == 400) { @@ -438,18 +490,17 @@ request.FileName is null __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -476,56 +527,17 @@ request.FileName is null __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Internal Server Error - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::Together.ErrorData? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - throw new global::Together.ApiException( - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -559,17 +571,15 @@ request.FileName is null } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -606,17 +616,15 @@ request.FileName is null { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -755,7 +763,9 @@ request.FileName is null var __pathBuilder = new global::Together.PathBuilder( path: "/files/upload", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -1033,6 +1043,43 @@ request.FileName is null retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // Internal Server Error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.ErrorData? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // Bad Request if ((int)__response.StatusCode == 400) { @@ -1058,18 +1105,17 @@ request.FileName is null __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -1096,56 +1142,17 @@ request.FileName is null __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; - } - // Internal Server Error - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::Together.ErrorData? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - throw new global::Together.ApiException( - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -1175,17 +1182,15 @@ request.FileName is null } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -1218,17 +1223,15 @@ request.FileName is null { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1322,7 +1325,9 @@ request.FileName is null var __pathBuilder = new global::Together.PathBuilder( path: "/files/upload", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -1600,6 +1605,43 @@ request.FileName is null retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // Internal Server Error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.ErrorData? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // Bad Request if ((int)__response.StatusCode == 400) { @@ -1625,18 +1667,17 @@ request.FileName is null __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -1663,56 +1704,17 @@ request.FileName is null __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Internal Server Error - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - global::Together.ErrorData? __value_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - throw new global::Together.ApiException( - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -1746,17 +1748,15 @@ request.FileName is null } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -1793,17 +1793,15 @@ request.FileName is null { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs b/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs index fb9b3b8b..577f2940 100644 --- a/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteFilesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteFilesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessDeleteFilesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/files/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteFilesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,17 +397,15 @@ partial void ProcessDeleteFilesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -429,17 +442,15 @@ partial void ProcessDeleteFilesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs index b7867d7f..3c1d1ed5 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFilesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessGetFilesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/files", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFilesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -371,17 +386,15 @@ partial void ProcessGetFilesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -418,17 +431,15 @@ partial void ProcessGetFilesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs index 0b71e6a0..05b2a394 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFilesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessGetFilesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/files/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,17 +397,15 @@ partial void ProcessGetFilesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -429,17 +442,15 @@ partial void ProcessGetFilesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs index 71eddd50..9701e748 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesByIdContentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFilesByIdContentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessGetFilesByIdContentResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/files/{id}/content", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdContentServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -377,18 +392,17 @@ partial void ProcessGetFilesByIdContentResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } try @@ -418,17 +432,15 @@ partial void ProcessGetFilesByIdContentResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -500,7 +512,9 @@ partial void ProcessGetFilesByIdContentResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/files/{id}/content", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdContentServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -745,18 +759,17 @@ partial void ProcessGetFilesByIdContentResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -784,16 +797,15 @@ partial void ProcessGetFilesByIdContentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: null, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -828,17 +840,15 @@ partial void ProcessGetFilesByIdContentResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FilesClient.g.cs b/src/libs/Together/Generated/Together.FilesClient.g.cs index e8dd7164..7c77f011 100644 --- a/src/libs/Together/Generated/Together.FilesClient.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class FilesClient : global::Together.IFilesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class FilesClient : global::Together.IFilesClient, global: public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class FilesClient : global::Together.IFilesClient, global: public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the FilesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs index 2ebed522..bd86a00f 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs @@ -8,6 +8,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateFineTunesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -139,7 +152,9 @@ partial void ProcessCreateFineTunesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/fine-tunes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -397,17 +412,15 @@ partial void ProcessCreateFineTunesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -444,17 +457,15 @@ partial void ProcessCreateFineTunesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -476,7 +487,7 @@ partial void ProcessCreateFineTunesResponseContent( /// File-ID of a validation file uploaded to the Together API /// /// - /// Whether to use sequence packing for training.
+ /// Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
/// Default Value: true /// /// @@ -502,8 +513,7 @@ partial void ProcessCreateFineTunesResponseContent( /// Default Value: max /// /// - /// Number of steps to accumulate gradients before performing a weight update. Effectively increases the batch size without requiring more memory. For example, with batch_size=4 and gradient_accumulation_steps=8, the effective batch size is 32.
- /// Default Value: 1 + /// Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used. /// /// /// Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
@@ -515,19 +525,35 @@ partial void ProcessCreateFineTunesResponseContent( /// /// /// The percent of steps at the start of training to linearly increase the learning rate.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
- /// Default Value: 1 + /// Default Value: 1.0 /// /// /// Weight decay. Regularization parameter for the optimizer.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42). /// + /// + /// Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.
+ /// Default Value: false + /// + /// + /// Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
+ /// Default Value: 2 + /// + /// + /// Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.
+ /// Default Value: 0.0 + /// + /// + /// Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.
+ /// Default Value: 1 + /// /// /// Suffix to add to your fine-tuned model name. Must be at most 64 characters long. /// @@ -583,12 +609,16 @@ partial void ProcessCreateFineTunesResponseContent( int? nEvals = default, global::Together.OneOf? batchSize = default, int? gradientAccumulationSteps = default, - float? learningRate = default, + double? learningRate = default, global::Together.LRScheduler? lrScheduler = default, - float? warmupRatio = default, - float? maxGradNorm = default, - float? weightDecay = default, + double? warmupRatio = default, + double? maxGradNorm = default, + double? weightDecay = default, int? randomSeed = default, + bool? earlyStoppingEnabled = default, + int? earlyStoppingPatience = default, + double? earlyStoppingMinDelta = default, + int? earlyStoppingWarmupEvals = default, string? suffix = default, string? wandbApiKey = default, string? wandbBaseUrl = default, @@ -624,6 +654,10 @@ partial void ProcessCreateFineTunesResponseContent( MaxGradNorm = maxGradNorm, WeightDecay = weightDecay, RandomSeed = randomSeed, + EarlyStoppingEnabled = earlyStoppingEnabled, + EarlyStoppingPatience = earlyStoppingPatience, + EarlyStoppingMinDelta = earlyStoppingMinDelta, + EarlyStoppingWarmupEvals = earlyStoppingWarmupEvals, Suffix = suffix, WandbApiKey = wandbApiKey, WandbBaseUrl = wandbBaseUrl, diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs index b468669b..9898f8d7 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesByIdCancelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateFineTunesByIdCancelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}/cancel", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesByIdCancelServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -371,17 +386,16 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 404) @@ -404,17 +418,16 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -448,17 +461,15 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -495,17 +506,15 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs index 2b1f231c..bd3968c2 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesEstimatePriceServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateFineTunesEstimatePriceSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,7 +62,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task CreateFineTunesEstimatePriceAsync( + public async global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( global::Together.CreateFineTunesEstimatePriceRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -72,7 +85,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsResponseAsync( + public async global::System.Threading.Tasks.Task>> CreateFineTunesEstimatePriceAsResponseAsync( global::Together.CreateFineTunesEstimatePriceRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -111,7 +124,9 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/fine-tunes/estimate-price", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesEstimatePriceServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -362,18 +377,17 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -397,9 +411,9 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( { __response.EnsureSuccessStatusCode(); - var __value = global::Together.CreateFineTunesEstimatePriceResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Together.OneOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Together.AutoSDKHttpResponse( + return new global::Together.AutoSDKHttpResponse>( statusCode: __response.StatusCode, headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), requestUri: __response.RequestMessage?.RequestUri, @@ -407,17 +421,15 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -431,9 +443,9 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( #endif ).ConfigureAwait(false); - var __value = await global::Together.CreateFineTunesEstimatePriceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Together.OneOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Together.AutoSDKHttpResponse( + return new global::Together.AutoSDKHttpResponse>( statusCode: __response.StatusCode, headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), requestUri: __response.RequestMessage?.RequestUri, @@ -454,17 +466,15 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -509,7 +519,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task CreateFineTunesEstimatePriceAsync( + public async global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( string trainingFile, string? validationFile = default, string? model = default, diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs new file mode 100644 index 00000000..79d3bf9e --- /dev/null +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs @@ -0,0 +1,722 @@ + +#nullable enable + +namespace Together +{ + public partial class FineTuningClient + { + + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesPreviewServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_CreateFineTunesPreviewSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_CreateFineTunesPreviewSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_CreateFineTunesPreviewSecurityRequirement0, + }; + partial void PrepareCreateFineTunesPreviewArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.FineTunePreviewRequest request); + partial void PrepareCreateFineTunesPreviewRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.FineTunePreviewRequest request); + partial void ProcessCreateFineTunesPreviewResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateFineTunesPreviewResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( + + global::Together.FineTunePreviewRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateFineTunesPreviewAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateFineTunesPreviewAsResponseAsync( + + global::Together.FineTunePreviewRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateFineTunesPreviewArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateFineTunesPreviewSecurityRequirements, + operationName: "CreateFineTunesPreviewAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/fine-tunes/preview", + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesPreviewServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateFineTunesPreviewRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createFineTunesPreview", + methodName: "CreateFineTunesPreviewAsync", + pathTemplate: "\"/fine-tunes/preview\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createFineTunesPreview", + methodName: "CreateFineTunesPreviewAsync", + pathTemplate: "\"/fine-tunes/preview\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createFineTunesPreview", + methodName: "CreateFineTunesPreviewAsync", + pathTemplate: "\"/fine-tunes/preview\"", + 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::Together.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); + ProcessCreateFineTunesPreviewResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createFineTunesPreview", + methodName: "CreateFineTunesPreviewAsync", + pathTemplate: "\"/fine-tunes/preview\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createFineTunesPreview", + methodName: "CreateFineTunesPreviewAsync", + pathTemplate: "\"/fine-tunes/preview\"", + 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); + } + // Invalid request or unsupported dataset for preview. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.OneOf? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.OneOf.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.OneOf.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException?>.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Together.ErrorData? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Training file not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal Server Error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.FineTunePreviewMessageError? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.FineTunePreviewMessageError.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.FineTunePreviewMessageError.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Preview service unavailable. + if ((int)__response.StatusCode == 502) + { + string? __content_502 = null; + global::System.Exception? __exception_502 = null; + global::Together.FineTunePreviewMessageError? __value_502 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_502 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_502 = global::Together.FineTunePreviewMessageError.FromJson(__content_502, JsonSerializerContext); + } + else + { + __content_502 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_502 = global::Together.FineTunePreviewMessageError.FromJson(__content_502, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_502 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_502 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_502, + responseBody: __content_502, + responseObject: __value_502, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Preview service is at capacity. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Together.FineTunePreviewDetailError? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Together.FineTunePreviewDetailError.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Together.FineTunePreviewDetailError.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + 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); + ProcessCreateFineTunesPreviewResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.FineTunePreviewResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.FineTunePreviewResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Name of the base model whose tokenizer and chat template will be used. + /// + /// + /// File-ID of the uploaded JSONL training file to sample for preview. + /// + /// + /// Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
+ /// Default Value: sft + /// + /// + /// Whether prompt or user-message tokens should contribute to training loss in the preview.
+ /// Default Value: false + /// + /// + /// Maximum number of rows from the start of the training file to tokenize.
+ /// Default Value: 5 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( + string model, + string trainingFile, + global::Together.FineTunePreviewRequestTrainingMethod? trainingMethod = default, + bool? trainOnInputs = default, + int? topK = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.FineTunePreviewRequest + { + Model = model, + TrainingFile = trainingFile, + TrainingMethod = trainingMethod, + TrainOnInputs = trainOnInputs, + TopK = topK, + }; + + return await CreateFineTunesPreviewAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs index 0c742645..a3365074 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteFineTunesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteFineTunesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -144,7 +157,9 @@ partial void ProcessDeleteFineTunesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteFineTunesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) ; @@ -393,18 +408,17 @@ partial void ProcessDeleteFineTunesByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -431,18 +445,17 @@ partial void ProcessDeleteFineTunesByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -476,17 +489,15 @@ partial void ProcessDeleteFineTunesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -523,17 +534,15 @@ partial void ProcessDeleteFineTunesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs index 3a5871f2..403167e3 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessGetFineTunesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/fine-tunes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -371,17 +386,15 @@ partial void ProcessGetFineTunesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -418,17 +431,15 @@ partial void ProcessGetFineTunesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs index b7757bac..00a972a4 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessGetFineTunesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,17 +397,15 @@ partial void ProcessGetFineTunesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -429,17 +442,15 @@ partial void ProcessGetFineTunesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs index 19fab9a4..a1ee8891 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdCheckpointsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesByIdCheckpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +143,9 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}/checkpoints", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdCheckpointsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -382,17 +397,15 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -429,17 +442,15 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs index d59554f2..5468dee0 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdEventsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesByIdEventsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}/events", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdEventsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -384,17 +399,15 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -431,17 +444,15 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs index dd237808..95701a69 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdMetricsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesByIdMetricsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -28,20 +41,20 @@ public partial class FineTuningClient partial void PrepareGetFineTunesByIdMetricsArguments( global::System.Net.Http.HttpClient httpClient, ref string id, - ref long? globalStepFrom, - ref long? globalStepTo, + ref int? globalStepFrom, + ref int? globalStepTo, ref global::System.DateTime? loggedAtFrom, ref global::System.DateTime? loggedAtTo, - ref long? resolution); + ref int? resolution); partial void PrepareGetFineTunesByIdMetricsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string id, - long? globalStepFrom, - long? globalStepTo, + int? globalStepFrom, + int? globalStepTo, global::System.DateTime? loggedAtFrom, global::System.DateTime? loggedAtTo, - long? resolution); + int? resolution); partial void ProcessGetFineTunesByIdMetricsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -72,11 +85,11 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( /// public async global::System.Threading.Tasks.Task GetFineTunesByIdMetricsAsync( string id, - long? globalStepFrom = default, - long? globalStepTo = default, + int? globalStepFrom = default, + int? globalStepTo = default, global::System.DateTime? loggedAtFrom = default, global::System.DateTime? loggedAtTo = default, - long? resolution = default, + int? resolution = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -114,11 +127,11 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( /// public async global::System.Threading.Tasks.Task> GetFineTunesByIdMetricsAsResponseAsync( string id, - long? globalStepFrom = default, - long? globalStepTo = default, + int? globalStepFrom = default, + int? globalStepTo = default, global::System.DateTime? loggedAtFrom = default, global::System.DateTime? loggedAtTo = default, - long? resolution = default, + int? resolution = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -158,7 +171,9 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/fine-tunes/{id}/metrics", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdMetricsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("global_step_from", globalStepFrom?.ToString()) .AddOptionalParameter("global_step_to", globalStepTo?.ToString()) @@ -411,17 +426,16 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 404) @@ -444,17 +458,16 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 500) @@ -477,17 +490,16 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -521,17 +533,15 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -568,17 +578,15 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs index 1c404913..4dd19659 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesModelsLimitsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesModelsLimitsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -118,7 +131,9 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/fine-tunes/models/limits", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesModelsLimitsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model_name", modelName) ; @@ -366,18 +381,17 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -411,17 +425,15 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -458,17 +470,15 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs index c4daa08f..af5b991b 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesModelsSupportedServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFineTunesModelsSupportedSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -106,7 +119,9 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/fine-tunes/models/supported", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFineTunesModelsSupportedServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -357,17 +372,15 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -404,17 +417,15 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs index c88ae981..4d6765db 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFinetuneDownloadServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetFinetuneDownloadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -53,7 +66,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. @@ -99,7 +112,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. @@ -160,7 +173,9 @@ partial void ProcessGetFinetuneDownloadResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/finetune/download", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFinetuneDownloadServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("ft_id", ftId) .AddOptionalParameter("checkpoint_step", checkpointStep?.ToString()) @@ -408,17 +423,16 @@ partial void ProcessGetFinetuneDownloadResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 404) @@ -441,17 +455,16 @@ partial void ProcessGetFinetuneDownloadResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } try @@ -481,17 +494,15 @@ partial void ProcessGetFinetuneDownloadResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -514,7 +525,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. @@ -575,7 +586,9 @@ partial void ProcessGetFinetuneDownloadResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/finetune/download", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetFinetuneDownloadServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("ft_id", ftId) .AddOptionalParameter("checkpoint_step", checkpointStep?.ToString()) @@ -823,17 +836,16 @@ partial void ProcessGetFinetuneDownloadResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 404) @@ -856,17 +868,16 @@ partial void ProcessGetFinetuneDownloadResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -894,16 +905,15 @@ partial void ProcessGetFinetuneDownloadResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: null, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -938,17 +948,15 @@ partial void ProcessGetFinetuneDownloadResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.g.cs index d523c14a..4696286d 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class FineTuningClient : global::Together.IFineTuningClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class FineTuningClient : global::Together.IFineTuningClien public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class FineTuningClient : global::Together.IFineTuningClien public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the FineTuningClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs index 67f427da..0a8e2b76 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs @@ -8,6 +8,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceCreateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GPUClusterServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -147,7 +160,9 @@ partial void ProcessGPUClusterServiceCreateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/clusters", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -405,17 +420,15 @@ partial void ProcessGPUClusterServiceCreateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -452,17 +465,15 @@ partial void ProcessGPUClusterServiceCreateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -509,10 +520,6 @@ partial void ProcessGPUClusterServiceCreateResponseContent( /// ON_DEMAND billing types will give you ownership of the cluster until you delete it.
/// SCHEDULED_CAPACITY billing types allow you to reserve capacity for a scheduled time window. You must specify the reservation_start_time and reservation_end_time with this request. /// - /// - /// Whether automated GPU node failover should be enabled for this cluster. By default, it is disabled.
- /// Default Value: false - /// /// /// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. /// @@ -579,7 +586,6 @@ partial void ProcessGPUClusterServiceCreateResponseContent( int? durationDays = default, global::Together.GPUClustersSharedVolumeCreateRequest? sharedVolume = default, string? volumeId = default, - bool? gpuNodeFailoverEnabled = default, int? autoScaleMaxGpus = default, int? slurmShmSizeGib = default, string? capacityPoolId = default, @@ -610,7 +616,6 @@ partial void ProcessGPUClusterServiceCreateResponseContent( SharedVolume = sharedVolume, VolumeId = volumeId, BillingType = billingType, - GpuNodeFailoverEnabled = gpuNodeFailoverEnabled, AutoScaleMaxGpus = autoScaleMaxGpus, SlurmShmSizeGib = slurmShmSizeGib, CapacityPoolId = capacityPoolId, diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs index 7809f61a..f087ecf3 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceDeleteServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GPUClusterServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,17 +389,15 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -421,17 +434,15 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs index daab3035..a0fae449 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceGetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GPUClusterServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGPUClusterServiceGetResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,17 +389,15 @@ partial void ProcessGPUClusterServiceGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -421,17 +434,15 @@ partial void ProcessGPUClusterServiceGetResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs index 07992010..61021923 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GPUClusterServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,9 +145,11 @@ partial void ProcessGPUClusterServiceListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/clusters", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder - .AddOptionalParameter("project_id", projectId) + .AddOptionalParameter("projectId", projectId) ; var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -387,17 +402,15 @@ partial void ProcessGPUClusterServiceListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -434,17 +447,15 @@ partial void ProcessGPUClusterServiceListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs index 640ba022..325fd67d 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceUpdateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GPUClusterServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -135,7 +148,9 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -394,17 +409,15 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -441,17 +454,15 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -485,6 +496,9 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( /// /// Updated desired number of preemptible GPUs for the cluster. When omitted, the current value is preserved. Must be a multiple of 8. /// + /// + /// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved. + /// /// /// Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge. /// @@ -499,6 +513,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( global::Together.InstanceClusterConfig? clusterConfig = default, int? numReservedGpus = default, int? numPreemptibleGpus = default, + int? numCapacityPoolGpus = default, global::System.Collections.Generic.IList? addOns = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -511,6 +526,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( ClusterConfig = clusterConfig, NumReservedGpus = numReservedGpus, NumPreemptibleGpus = numPreemptibleGpus, + NumCapacityPoolGpus = numCapacityPoolGpus, AddOns = addOns, }; diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs index 2f7e5dd6..b374d4db 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class GPUClusterServiceClient : global::Together.IGPUClusterServiceClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class GPUClusterServiceClient : global::Together.IGPUClust public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class GPUClusterServiceClient : global::Together.IGPUClust public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the GPUClusterServiceClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs b/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs index b86330ab..1b773a78 100644 --- a/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs +++ b/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class HardwareClient { + private static readonly global::Together.AutoSDKServer[] s_ListHardwareServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ListHardwareSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -138,7 +151,9 @@ partial void ProcessListHardwareResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/hardware", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ListHardwareServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("model", model) ; @@ -386,18 +401,17 @@ partial void ProcessListHardwareResponseContent( __exception_403 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal error if ((int)__response.StatusCode == 500) @@ -424,18 +438,17 @@ partial void ProcessListHardwareResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -469,17 +482,15 @@ partial void ProcessListHardwareResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -516,17 +527,15 @@ partial void ProcessListHardwareResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.HardwareClient.g.cs b/src/libs/Together/Generated/Together.HardwareClient.g.cs index 36556f0a..23a5a3fd 100644 --- a/src/libs/Together/Generated/Together.HardwareClient.g.cs +++ b/src/libs/Together/Generated/Together.HardwareClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class HardwareClient : global::Together.IHardwareClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class HardwareClient : global::Together.IHardwareClient, g public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class HardwareClient : global::Together.IHardwareClient, g public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the HardwareClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs b/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs new file mode 100644 index 00000000..8e24f61c --- /dev/null +++ b/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs @@ -0,0 +1,534 @@ + +#nullable enable + +namespace Together +{ + public partial class HealthCheckServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_HealthCheckServiceListPassiveHealthCheckAlertsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_HealthCheckServiceListPassiveHealthCheckAlertsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_HealthCheckServiceListPassiveHealthCheckAlertsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_HealthCheckServiceListPassiveHealthCheckAlertsSecurityRequirement0, + }; + partial void PrepareHealthCheckServiceListPassiveHealthCheckAlertsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? intentId, + ref string? instanceId, + ref string? clusterId, + ref int? pageSize, + ref string? pageToken, + ref global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status, + global::System.Collections.Generic.IList? severityFilter); + partial void PrepareHealthCheckServiceListPassiveHealthCheckAlertsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? intentId, + string? instanceId, + string? clusterId, + int? pageSize, + string? pageToken, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status, + global::System.Collections.Generic.IList? severityFilter); + partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List passive health check alerts
+ /// Lists passive health check alerts. Filters combine across axes; empty values skip that axis. + ///
+ /// + /// Remediation intent ID to filter by. + /// + /// + /// Instance ID to filter by. + /// + /// + /// Optional instance cluster ID to filter by. Required for non-admin callers. + /// + /// + /// Max number of results to return.
+ /// Default Value: 50 + /// + /// + /// Opaque pagination token from the previous response. + /// + /// + /// Lifecycle filter. Omit to return firing alerts. + /// + /// + /// Severity tiers to include. Omit or pass an empty array to include all severities. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task HealthCheckServiceListPassiveHealthCheckAlertsAsync( + string? intentId = default, + string? instanceId = default, + string? clusterId = default, + int? pageSize = default, + string? pageToken = default, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status = default, + global::System.Collections.Generic.IList? severityFilter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await HealthCheckServiceListPassiveHealthCheckAlertsAsResponseAsync( + intentId: intentId, + instanceId: instanceId, + clusterId: clusterId, + pageSize: pageSize, + pageToken: pageToken, + status: status, + severityFilter: severityFilter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List passive health check alerts
+ /// Lists passive health check alerts. Filters combine across axes; empty values skip that axis. + ///
+ /// + /// Remediation intent ID to filter by. + /// + /// + /// Instance ID to filter by. + /// + /// + /// Optional instance cluster ID to filter by. Required for non-admin callers. + /// + /// + /// Max number of results to return.
+ /// Default Value: 50 + /// + /// + /// Opaque pagination token from the previous response. + /// + /// + /// Lifecycle filter. Omit to return firing alerts. + /// + /// + /// Severity tiers to include. Omit or pass an empty array to include all severities. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> HealthCheckServiceListPassiveHealthCheckAlertsAsResponseAsync( + string? intentId = default, + string? instanceId = default, + string? clusterId = default, + int? pageSize = default, + string? pageToken = default, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status = default, + global::System.Collections.Generic.IList? severityFilter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareHealthCheckServiceListPassiveHealthCheckAlertsArguments( + httpClient: HttpClient, + intentId: ref intentId, + instanceId: ref instanceId, + clusterId: ref clusterId, + pageSize: ref pageSize, + pageToken: ref pageToken, + status: ref status, + severityFilter: severityFilter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_HealthCheckServiceListPassiveHealthCheckAlertsSecurityRequirements, + operationName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/compute/passive_health_check_alerts", + baseUri: ResolveBaseUri( + servers: s_HealthCheckServiceListPassiveHealthCheckAlertsServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("intent_id", intentId) + .AddOptionalParameter("instance_id", instanceId) + .AddOptionalParameter("cluster_id", clusterId) + .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_token", pageToken) + .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("severity_filter", severityFilter, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareHealthCheckServiceListPassiveHealthCheckAlertsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + intentId: intentId, + instanceId: instanceId, + clusterId: clusterId, + pageSize: pageSize, + pageToken: pageToken, + status: status, + severityFilter: severityFilter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", + methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", + pathTemplate: "\"/compute/passive_health_check_alerts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", + methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", + pathTemplate: "\"/compute/passive_health_check_alerts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", + methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", + pathTemplate: "\"/compute/passive_health_check_alerts\"", + httpMethod: "GET", + 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::Together.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); + ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", + methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", + pathTemplate: "\"/compute/passive_health_check_alerts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", + methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", + pathTemplate: "\"/compute/passive_health_check_alerts\"", + httpMethod: "GET", + 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); + } + + 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); + ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListPassiveHealthCheckAlertsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.ListPassiveHealthCheckAlertsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.HealthCheckServiceClient.g.cs b/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs new file mode 100644 index 00000000..e6659894 --- /dev/null +++ b/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs @@ -0,0 +1,284 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class HealthCheckServiceClient : global::Together.IHealthCheckServiceClient, global::System.IDisposable + { + /// + /// Default environment for APIs + /// + public const string DefaultBaseUrl = "https://api.together.ai/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + + /// + /// Creates a new instance of the HealthCheckServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public HealthCheckServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the HealthCheckServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public HealthCheckServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the HealthCheckServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public HealthCheckServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs new file mode 100644 index 00000000..d89715ad --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs @@ -0,0 +1,80 @@ +#nullable enable + +namespace Together +{ + public partial interface IABExperimentServiceClient + { + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateABExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ABExperimentServiceCreateABExperimentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateABExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + /// + /// Optional free-form description. + /// + /// + /// Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( + string projectId, + string endpointId, + string name, + global::System.Collections.Generic.IList members, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs new file mode 100644 index 00000000..3291afc0 --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IABExperimentServiceClient + { + /// + /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceDeleteABExperimentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ABExperimentServiceDeleteABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs new file mode 100644 index 00000000..7d88529f --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IABExperimentServiceClient + { + /// + /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceGetABExperimentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ABExperimentServiceGetABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs new file mode 100644 index 00000000..5d65f550 --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IABExperimentServiceClient + { + /// + /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of A/B experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous A/B experiment list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceListABExperimentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of A/B experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous A/B experiment list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ABExperimentServiceListABExperimentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs new file mode 100644 index 00000000..cfa2ac66 --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace Together +{ + public partial interface IABExperimentServiceClient + { + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateABExperimentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ABExperimentServiceUpdateABExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateABExperimentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// A/B experiment identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Updated free-form description. + /// + /// + /// Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( + string projectId, + string endpointId, + string id, + string? updateMask = default, + string? description = default, + global::System.Collections.Generic.IList? members = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.g.cs new file mode 100644 index 00000000..27f4508f --- /dev/null +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IABExperimentServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs b/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs new file mode 100644 index 00000000..6d992367 --- /dev/null +++ b/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace Together +{ + public partial interface IAccountClient + { + /// + /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity) + ///
+ global::System.Threading.Tasks.Task WhoamiAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity) + ///
+ global::System.Threading.Tasks.Task> WhoamiAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IAccountClient.g.cs b/src/libs/Together/Generated/Together.IAccountClient.g.cs new file mode 100644 index 00000000..83caaffc --- /dev/null +++ b/src/libs/Together/Generated/Together.IAccountClient.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAccountClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs index 93c1a3ea..0656b94e 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs @@ -61,7 +61,7 @@ public partial interface IAudioClient /// Transcribes audio into text ///
/// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for transcription
@@ -81,7 +81,7 @@ public partial interface IAudioClient /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -119,7 +119,7 @@ public partial interface IAudioClient string? language = default, string? prompt = default, global::Together.AudioTranscriptionRequestResponseFormat? responseFormat = default, - float? temperature = default, + double? temperature = default, global::Together.OneOf>? timestampGranularities = default, bool? diarize = default, int? minSpeakers = default, diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs index 6f947449..1d8d16e9 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs @@ -65,7 +65,7 @@ public partial interface IAudioClient /// Translates audio into English ///
/// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for translation
@@ -85,7 +85,7 @@ public partial interface IAudioClient /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -101,7 +101,7 @@ public partial interface IAudioClient string? language = default, string? prompt = default, global::Together.AudioTranslationRequestResponseFormat? responseFormat = default, - float? temperature = default, + double? temperature = default, global::Together.OneOf>? timestampGranularities = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs index 00c0b57d..303954bf 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs @@ -57,7 +57,7 @@ public partial interface IAudioClient /// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
@@ -242,7 +242,7 @@ public partial interface IAudioClient /// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
diff --git a/src/libs/Together/Generated/Together.IAudioClient.g.cs b/src/libs/Together/Generated/Together.IAudioClient.g.cs index da79cd0c..e4c996ff 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.g.cs @@ -19,6 +19,27 @@ public partial interface IAudioClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IBatchesClient.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.g.cs index 542e6ccb..25df4efc 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IBatchesClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs b/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs index ef7fcb37..5b43fa16 100644 --- a/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs @@ -116,7 +116,7 @@ public partial interface IChatClient /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -162,18 +162,18 @@ public partial interface IChatClient string model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default, double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.OneOf? functionCall = default, global::Together.ResponseFormat? responseFormat = default, diff --git a/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs index f8ce615c..5e558bb8 100644 --- a/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs @@ -87,7 +87,7 @@ public partial interface IChatClient /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -133,18 +133,18 @@ public partial interface IChatClient string model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default, double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.OneOf? functionCall = default, global::Together.ResponseFormat? responseFormat = default, diff --git a/src/libs/Together/Generated/Together.IChatClient.g.cs b/src/libs/Together/Generated/Together.IChatClient.g.cs index bf5771ff..ae2d8cd0 100644 --- a/src/libs/Together/Generated/Together.IChatClient.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.g.cs @@ -19,6 +19,27 @@ public partial interface IChatClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs b/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs index 579acee4..0b5065ec 100644 --- a/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs +++ b/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs @@ -19,6 +19,27 @@ public partial interface ICodeInterpreterClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs index 1fc4212c..311c7882 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs @@ -112,7 +112,7 @@ public partial interface ICompletionClient /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -126,18 +126,18 @@ public partial interface ICompletionClient global::Together.AnyOf model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, - float? repetitionPenalty = default, + double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, global::Together.AnyOf? safetyModel = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs index 13f0de08..e2b2a0ea 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs @@ -85,7 +85,7 @@ public partial interface ICompletionClient /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -99,18 +99,18 @@ public partial interface ICompletionClient global::Together.AnyOf model, int? maxTokens = default, global::System.Collections.Generic.IList? stop = default, - float? temperature = default, - float? topP = default, + double? temperature = default, + double? topP = default, int? topK = default, - float? repetitionPenalty = default, + double? repetitionPenalty = default, int? logprobs = default, bool? echo = default, int? n = default, global::Together.AnyOf? safetyModel = default, - float? minP = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - global::System.Collections.Generic.Dictionary? logitBias = default, + double? minP = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.Dictionary? logitBias = default, int? seed = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.ICompletionClient.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.g.cs index af6f5447..96edf15f 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.g.cs @@ -19,6 +19,27 @@ public partial interface ICompletionClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs new file mode 100644 index 00000000..89426334 --- /dev/null +++ b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IConfigServiceClient + { + /// + /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications. + ///
+ /// + /// Project identifier. + /// + /// + /// Config revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ConfigServiceGetProjectConfigAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications. + ///
+ /// + /// Project identifier. + /// + /// + /// Config revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ConfigServiceGetProjectConfigAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs new file mode 100644 index 00000000..0b214487 --- /dev/null +++ b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IConfigServiceClient + { + /// + /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree. + /// + /// + /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ConfigServiceListProjectConfigsAsync( + string projectId, + string? referenceModelId = default, + string? referenceModel = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree. + /// + /// + /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ConfigServiceListProjectConfigsAsResponseAsync( + string projectId, + string? referenceModelId = default, + string? referenceModel = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IConfigServiceClient.g.cs b/src/libs/Together/Generated/Together.IConfigServiceClient.g.cs new file mode 100644 index 00000000..e519392b --- /dev/null +++ b/src/libs/Together/Generated/Together.IConfigServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IConfigServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs new file mode 100644 index 00000000..848242fe --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + + global::Together.DeAddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceAddAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + + global::Together.DeAddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier to attach. + /// + /// + /// Optional adapter revision to pin. If omitted, the latest revision is resolved at request time. + /// + /// + /// Whether to evict the oldest adapter if the deployment is at adapter capacity. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string adapterModelId, + string? adapterRevisionId = default, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs new file mode 100644 index 00000000..f92bc466 --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs @@ -0,0 +1,116 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateDeploymentRequest request, + bool? validateOnly = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceCreateDeploymentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateDeploymentRequest request, + bool? validateOnly = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint that will contain the deployment. + /// + /// + /// When true, validates the request without creating or provisioning a deployment. + /// + /// + /// Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string. + /// + /// + /// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset. + /// + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation. + /// + /// + /// Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset. + /// + /// + /// Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time. + /// + /// + /// Autoscaling configuration for the deployment. + /// + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model. + /// + /// + /// Enables dynamic loading of LoRA adapters on the deployment. + /// + /// + /// Placement policy to use when scheduling the deployment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( + string projectId, + string endpointId, + string name, + global::Together.DeAutoscaling autoscaling, + bool? validateOnly = default, + string? modelId = default, + string? modelRevisionId = default, + string? configId = default, + string? model = default, + string? config = default, + bool? enableLora = default, + global::Together.DePlacement? placement = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs new file mode 100644 index 00000000..04aac32a --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceDeleteDeploymentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceDeleteDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs new file mode 100644 index 00000000..19712806 --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceGetAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceGetAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs new file mode 100644 index 00000000..81bf102a --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceGetDeploymentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceGetDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs new file mode 100644 index 00000000..397ec97c --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Maximum number of adapters to return. + /// + /// + /// Cursor from a previous adapter list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceListAdaptersAsync( + string projectId, + string endpointId, + string deploymentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Maximum number of adapters to return. + /// + /// + /// Cursor from a previous adapter list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceListAdaptersAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs new file mode 100644 index 00000000..c241737f --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs @@ -0,0 +1,76 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint whose deployments are listed. + /// + /// + /// Maximum number of deployments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous deployment list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_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 DeploymentServiceListDeploymentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. + ///
+ /// + /// ID of the project that owns the endpoint. + /// + /// + /// ID of the endpoint whose deployments are listed. + /// + /// + /// Maximum number of deployments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous deployment list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_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> DeploymentServiceListDeploymentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs new file mode 100644 index 00000000..78ec808a --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceRemoveAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceRemoveAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs new file mode 100644 index 00000000..f7c584f7 --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs @@ -0,0 +1,100 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + + global::Together.DeUpdateAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceUpdateAdapterAsResponseAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + + global::Together.DeUpdateAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Adapter model identifier. + /// + /// + /// New adapter revision to pin. + /// + /// + /// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( + string projectId, + string endpointId, + string deploymentId, + string id, + string adapterRevisionId, + string etag, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs new file mode 100644 index 00000000..882579d3 --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace Together +{ + public partial interface IDeploymentServiceClient + { + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateDeploymentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeploymentServiceUpdateDeploymentAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeUpdateDeploymentRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment identifier. + /// + /// + /// Fields to update. If not set, the fields populated on `deployment` are updated. + /// + /// + /// Updated endpoint string. + /// + /// + /// Updated autoscaling configuration. + /// + /// + /// Current deployment version. The update is rejected if this value no longer matches. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( + string projectId, + string endpointId, + string id, + string? updateMask = default, + string? name = default, + global::Together.DeAutoscaling? autoscaling = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.g.cs new file mode 100644 index 00000000..7bce8756 --- /dev/null +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IDeploymentServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs index 9c01c1c7..4893ee5a 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs index bfe1a15a..f37cc8b3 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsStorageClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs index b9cc47a9..f260589a 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsVolumesClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs b/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs index d2bc410c..5b82b4a6 100644 --- a/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs +++ b/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IEmbeddingsClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs new file mode 100644 index 00000000..87fd7b34 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs @@ -0,0 +1,65 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( + string projectId, + + global::Together.DeCreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceCreateEndpointAsResponseAsync( + string projectId, + + global::Together.DeCreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an endpoint
+ /// Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + ///
+ /// + /// Project identifier. + /// + /// + /// Inference-addressable endpoint name to create. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( + string projectId, + string name, + global::Together.DeCreateEndpointRequestVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs new file mode 100644 index 00000000..15457e1d --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// Delete an endpoint
+ /// Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceDeleteEndpointAsync( + string projectId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an endpoint
+ /// Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceDeleteEndpointAsResponseAsync( + string projectId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs new file mode 100644 index 00000000..72042fc7 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// Get an endpoint
+ /// Retrieves an endpoint and lightweight summaries of the deployments attached to it. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceGetEndpointAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an endpoint
+ /// Retrieves an endpoint and lightweight summaries of the deployments attached to it. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs new file mode 100644 index 00000000..39d0f164 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs @@ -0,0 +1,84 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// Get endpoint analytics
+ /// Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Restrict to a single deployment under this endpoint. + /// + /// + /// Inclusive start of the time range. Defaults to 24 hours ago if unset. + /// + /// + /// Exclusive end of the time range. Defaults to now if unset. + /// + /// + /// When true, include per-bucket time series in the response. + /// + /// + /// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceGetEndpointAnalyticsAsync( + string projectId, + string id, + string? deploymentId = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + bool? includeTimeSeries = default, + string? granularity = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get endpoint analytics
+ /// Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Restrict to a single deployment under this endpoint. + /// + /// + /// Inclusive start of the time range. Defaults to 24 hours ago if unset. + /// + /// + /// Exclusive end of the time range. Defaults to now if unset. + /// + /// + /// When true, include per-bucket time series in the response. + /// + /// + /// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAnalyticsAsResponseAsync( + string projectId, + string id, + string? deploymentId = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + bool? includeTimeSeries = default, + string? granularity = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs new file mode 100644 index 00000000..45c91851 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs @@ -0,0 +1,116 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// List endpoint events
+ /// Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of events to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous endpoint event list response. + /// + /// + /// Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND. + /// + /// + /// Minimum severity. Omit to disable severity filtering. + /// + /// + /// Return only events at or after this time. + /// + /// + /// Return only events strictly before this time. + /// + /// + /// Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`. + /// + /// + /// Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events. + /// + /// + /// ID of a subject associated with the event, such as a rollout. Combined with other filters using AND. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceListEndpointEventsAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::System.Collections.Generic.IList? types = default, + global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel = default, + global::System.DateTime? since = default, + global::System.DateTime? until = default, + global::System.Collections.Generic.IList? deploymentIds = default, + global::System.Collections.Generic.IList? sourceKinds = default, + string? subjectId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List endpoint events
+ /// Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of events to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous endpoint event list response. + /// + /// + /// Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND. + /// + /// + /// Minimum severity. Omit to disable severity filtering. + /// + /// + /// Return only events at or after this time. + /// + /// + /// Return only events strictly before this time. + /// + /// + /// Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`. + /// + /// + /// Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events. + /// + /// + /// ID of a subject associated with the event, such as a rollout. Combined with other filters using AND. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceListEndpointEventsAsResponseAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::System.Collections.Generic.IList? types = default, + global::Together.EndpointServiceListEndpointEventsMinLevel? minLevel = default, + global::System.DateTime? since = default, + global::System.DateTime? until = default, + global::System.Collections.Generic.IList? deploymentIds = default, + global::System.Collections.Generic.IList? sourceKinds = default, + string? subjectId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs new file mode 100644 index 00000000..3f261bb4 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs @@ -0,0 +1,70 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// List endpoints
+ /// Lists the dedicated inference endpoints owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of endpoints to return.
+ /// Default Value: 50 + /// + /// + /// Cursor from a previous response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `<project_slug>/<endpoint_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 EndpointServiceListEndpointsAsync( + string projectId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List endpoints
+ /// Lists the dedicated inference endpoints owned by the specified project. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of endpoints to return.
+ /// Default Value: 50 + /// + /// + /// Cursor from a previous response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `<project_slug>/<endpoint_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> EndpointServiceListEndpointsAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs new file mode 100644 index 00000000..3d4c1437 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// List organization endpoints
+ /// Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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 EndpointServiceListOrganizationEndpointsAsync( + string organizationId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List organization endpoints
+ /// Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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> EndpointServiceListOrganizationEndpointsAsResponseAsync( + string organizationId, + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs new file mode 100644 index 00000000..22ad1a82 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// List public endpoints
+ /// Lists endpoints that are publicly visible across Together projects. + ///
+ /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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 EndpointServiceListPublicEndpointsAsync( + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List public endpoints
+ /// Lists endpoints that are publicly visible across Together projects. + ///
+ /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// + /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + /// + /// + /// Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint 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> EndpointServiceListPublicEndpointsAsResponseAsync( + int? limit = default, + string? after = default, + string? orderBy = default, + string? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs new file mode 100644 index 00000000..75e990a9 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs @@ -0,0 +1,97 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointServiceClient + { + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( + string projectId, + string id, + + global::Together.DeEndpointUpdate request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EndpointServiceUpdateEndpointAsResponseAsync( + string projectId, + string id, + + global::Together.DeEndpointUpdate request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an endpoint
+ /// Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Fields to update. If not set, the fields populated are updated. + /// + /// + /// Updated endpoint string. + /// + /// + /// Current endpoint version. The update is rejected if this value no longer matches. + /// + /// + /// Replacement live traffic split. Use an empty list to stop routing live traffic. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( + string projectId, + string id, + string? updateMask = default, + string? name = default, + string? etag = default, + global::System.Collections.Generic.IList? trafficSplit = default, + global::Together.DeEndpointUpdateVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.g.cs new file mode 100644 index 00000000..8d81dd4f --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IEndpointServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs b/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs index f87c4c92..194eef76 100644 --- a/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs +++ b/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs @@ -19,6 +19,27 @@ public partial interface IEndpoints2Client : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs new file mode 100644 index 00000000..9d8bd879 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs @@ -0,0 +1,91 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ global::System.Threading.Tasks.Task> AddAdapterAsResponseAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs new file mode 100644 index 00000000..39b1556a --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("endpoint-abc123")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ global::System.Threading.Tasks.Task ListAdaptersAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("endpoint-abc123")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ global::System.Threading.Tasks.Task> ListAdaptersAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs new file mode 100644 index 00000000..5ebc827e --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs @@ -0,0 +1,79 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ global::System.Threading.Tasks.Task RemoveAdapterAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "endpoint-abc123",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ global::System.Threading.Tasks.Task> RemoveAdapterAsResponseAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_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 RemoveAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.g.cs index c6aafc8a..d9e37f81 100644 --- a/src/libs/Together/Generated/Together.IEndpointsClient.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IEndpointsClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.g.cs index eb63fd71..0de98b29 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.g.cs @@ -19,6 +19,27 @@ public partial interface IEvaluationClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IFilesClient.g.cs b/src/libs/Together/Generated/Together.IFilesClient.g.cs index af2489ee..ee30df2f 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IFilesClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs index 5954c269..024a686e 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs @@ -69,7 +69,7 @@ public partial interface IFineTuningClient /// File-ID of a validation file uploaded to the Together API /// /// - /// Whether to use sequence packing for training.
+ /// Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
/// Default Value: true /// /// @@ -95,8 +95,7 @@ public partial interface IFineTuningClient /// Default Value: max /// /// - /// Number of steps to accumulate gradients before performing a weight update. Effectively increases the batch size without requiring more memory. For example, with batch_size=4 and gradient_accumulation_steps=8, the effective batch size is 32.
- /// Default Value: 1 + /// Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used. /// /// /// Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
@@ -108,19 +107,35 @@ public partial interface IFineTuningClient /// /// /// The percent of steps at the start of training to linearly increase the learning rate.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
- /// Default Value: 1 + /// Default Value: 1.0 /// /// /// Weight decay. Regularization parameter for the optimizer.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42). /// + /// + /// Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.
+ /// Default Value: false + /// + /// + /// Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
+ /// Default Value: 2 + /// + /// + /// Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.
+ /// Default Value: 0.0 + /// + /// + /// Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.
+ /// Default Value: 1 + /// /// /// Suffix to add to your fine-tuned model name. Must be at most 64 characters long. /// @@ -176,12 +191,16 @@ public partial interface IFineTuningClient int? nEvals = default, global::Together.OneOf? batchSize = default, int? gradientAccumulationSteps = default, - float? learningRate = default, + double? learningRate = default, global::Together.LRScheduler? lrScheduler = default, - float? warmupRatio = default, - float? maxGradNorm = default, - float? weightDecay = default, + double? warmupRatio = default, + double? maxGradNorm = default, + double? weightDecay = default, int? randomSeed = default, + bool? earlyStoppingEnabled = default, + int? earlyStoppingPatience = default, + double? earlyStoppingMinDelta = default, + int? earlyStoppingWarmupEvals = default, string? suffix = default, string? wandbApiKey = default, string? wandbBaseUrl = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs index 722e71d7..b92e0c50 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs @@ -12,7 +12,7 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task CreateFineTunesEstimatePriceAsync( + global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( global::Together.CreateFineTunesEstimatePriceRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -25,7 +25,7 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsResponseAsync( + global::System.Threading.Tasks.Task>> CreateFineTunesEstimatePriceAsResponseAsync( global::Together.CreateFineTunesEstimatePriceRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -64,7 +64,7 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task CreateFineTunesEstimatePriceAsync( + global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( string trainingFile, string? validationFile = default, string? model = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs new file mode 100644 index 00000000..3997f46e --- /dev/null +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs @@ -0,0 +1,67 @@ +#nullable enable + +namespace Together +{ + public partial interface IFineTuningClient + { + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( + + global::Together.FineTunePreviewRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateFineTunesPreviewAsResponseAsync( + + global::Together.FineTunePreviewRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Preview tokenized data
+ /// Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + ///
+ /// + /// Name of the base model whose tokenizer and chat template will be used. + /// + /// + /// File-ID of the uploaded JSONL training file to sample for preview. + /// + /// + /// Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
+ /// Default Value: sft + /// + /// + /// Whether prompt or user-message tokens should contribute to training loss in the preview.
+ /// Default Value: false + /// + /// + /// Maximum number of rows from the start of the training file to tokenize.
+ /// Default Value: 5 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( + string model, + string trainingFile, + global::Together.FineTunePreviewRequestTrainingMethod? trainingMethod = default, + bool? trainOnInputs = default, + int? topK = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs index 24014ef4..125e7b70 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs @@ -25,11 +25,11 @@ public partial interface IFineTuningClient /// global::System.Threading.Tasks.Task GetFineTunesByIdMetricsAsync( string id, - long? globalStepFrom = default, - long? globalStepTo = default, + int? globalStepFrom = default, + int? globalStepTo = default, global::System.DateTime? loggedAtFrom = default, global::System.DateTime? loggedAtTo = default, - long? resolution = default, + int? resolution = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -53,11 +53,11 @@ public partial interface IFineTuningClient /// global::System.Threading.Tasks.Task> GetFineTunesByIdMetricsAsResponseAsync( string id, - long? globalStepFrom = default, - long? globalStepTo = default, + int? globalStepFrom = default, + int? globalStepTo = default, global::System.DateTime? loggedAtFrom = default, global::System.DateTime? loggedAtTo = default, - long? resolution = default, + int? resolution = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs index f23c2373..c04cc1f2 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs @@ -12,7 +12,7 @@ public partial interface IFineTuningClient /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. @@ -47,7 +47,7 @@ public partial interface IFineTuningClient /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. @@ -82,7 +82,7 @@ public partial interface IFineTuningClient /// Fine-tune ID to download. A string that starts with `ft-`. /// /// - /// Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. + /// Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. /// /// /// Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.g.cs index 98ca966e..1628ed58 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.g.cs @@ -19,6 +19,27 @@ public partial interface IFineTuningClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs index 1797a51c..a378bdab 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs @@ -102,10 +102,6 @@ public partial interface IGPUClusterServiceClient /// ON_DEMAND billing types will give you ownership of the cluster until you delete it.
/// SCHEDULED_CAPACITY billing types allow you to reserve capacity for a scheduled time window. You must specify the reservation_start_time and reservation_end_time with this request. /// - /// - /// Whether automated GPU node failover should be enabled for this cluster. By default, it is disabled.
- /// Default Value: false - /// /// /// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. /// @@ -172,7 +168,6 @@ public partial interface IGPUClusterServiceClient int? durationDays = default, global::Together.GPUClustersSharedVolumeCreateRequest? sharedVolume = default, string? volumeId = default, - bool? gpuNodeFailoverEnabled = default, int? autoScaleMaxGpus = default, int? slurmShmSizeGib = default, string? capacityPoolId = default, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs index f6b5e68b..049b7290 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs @@ -73,6 +73,9 @@ public partial interface IGPUClusterServiceClient /// /// Updated desired number of preemptible GPUs for the cluster. When omitted, the current value is preserved. Must be a multiple of 8. /// + /// + /// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved. + /// /// /// Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge. /// @@ -87,6 +90,7 @@ public partial interface IGPUClusterServiceClient global::Together.InstanceClusterConfig? clusterConfig = default, int? numReservedGpus = default, int? numPreemptibleGpus = default, + int? numCapacityPoolGpus = default, global::System.Collections.Generic.IList? addOns = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs index dff63e51..843c03ba 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IGPUClusterServiceClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IHardwareClient.g.cs b/src/libs/Together/Generated/Together.IHardwareClient.g.cs index af759c7f..d4409b71 100644 --- a/src/libs/Together/Generated/Together.IHardwareClient.g.cs +++ b/src/libs/Together/Generated/Together.IHardwareClient.g.cs @@ -19,6 +19,27 @@ public partial interface IHardwareClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IHealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs new file mode 100644 index 00000000..b4d17298 --- /dev/null +++ b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs @@ -0,0 +1,86 @@ +#nullable enable + +namespace Together +{ + public partial interface IHealthCheckServiceClient + { + /// + /// List passive health check alerts
+ /// Lists passive health check alerts. Filters combine across axes; empty values skip that axis. + ///
+ /// + /// Remediation intent ID to filter by. + /// + /// + /// Instance ID to filter by. + /// + /// + /// Optional instance cluster ID to filter by. Required for non-admin callers. + /// + /// + /// Max number of results to return.
+ /// Default Value: 50 + /// + /// + /// Opaque pagination token from the previous response. + /// + /// + /// Lifecycle filter. Omit to return firing alerts. + /// + /// + /// Severity tiers to include. Omit or pass an empty array to include all severities. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task HealthCheckServiceListPassiveHealthCheckAlertsAsync( + string? intentId = default, + string? instanceId = default, + string? clusterId = default, + int? pageSize = default, + string? pageToken = default, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status = default, + global::System.Collections.Generic.IList? severityFilter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List passive health check alerts
+ /// Lists passive health check alerts. Filters combine across axes; empty values skip that axis. + ///
+ /// + /// Remediation intent ID to filter by. + /// + /// + /// Instance ID to filter by. + /// + /// + /// Optional instance cluster ID to filter by. Required for non-admin callers. + /// + /// + /// Max number of results to return.
+ /// Default Value: 50 + /// + /// + /// Opaque pagination token from the previous response. + /// + /// + /// Lifecycle filter. Omit to return firing alerts. + /// + /// + /// Severity tiers to include. Omit or pass an empty array to include all severities. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> HealthCheckServiceListPassiveHealthCheckAlertsAsResponseAsync( + string? intentId = default, + string? instanceId = default, + string? clusterId = default, + int? pageSize = default, + string? pageToken = default, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? status = default, + global::System.Collections.Generic.IList? severityFilter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs new file mode 100644 index 00000000..ae11c11d --- /dev/null +++ b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IHealthCheckServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IImagesClient.g.cs b/src/libs/Together/Generated/Together.IImagesClient.g.cs index 1369fc5a..b4104792 100644 --- a/src/libs/Together/Generated/Together.IImagesClient.g.cs +++ b/src/libs/Together/Generated/Together.IImagesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IImagesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs index 7db88519..2cc1c60c 100644 --- a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs @@ -42,9 +42,15 @@ public partial interface IInstanceClusterAddOnServiceClient /// /// The ID of the cluster to create the add-on on. /// - /// - /// - /// + /// + /// Human-readable name for this add-on instance. + /// + /// + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass', 'headlamp'. + /// + /// + /// Configuration for a cluster add-on. + /// /// 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/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs index 946660e4..35f84d52 100644 --- a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs @@ -53,7 +53,9 @@ public partial interface IInstanceClusterAddOnServiceClient /// /// The ID of the add-on to update. /// - /// + /// + /// Configuration for a cluster add-on. + /// /// 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/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs index 98237b9c..72f7ad02 100644 --- a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IInstanceClusterAddOnServiceClient : global::System.IDi /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs new file mode 100644 index 00000000..8fb65e5f --- /dev/null +++ b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Together +{ + public partial interface IInstanceTypeServiceClient + { + /// + /// Get an inference instance type
+ /// Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. + ///
+ /// + /// Resource identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task InstanceTypeServiceGetInferenceInstanceTypeAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an inference instance type
+ /// Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. + ///
+ /// + /// Resource identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> InstanceTypeServiceGetInferenceInstanceTypeAsResponseAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs new file mode 100644 index 00000000..27061ac8 --- /dev/null +++ b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace Together +{ + public partial interface IInstanceTypeServiceClient + { + /// + /// List inference instance types
+ /// Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task InstanceTypeServiceListInferenceInstanceTypesAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List inference instance types
+ /// Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> InstanceTypeServiceListInferenceInstanceTypesAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.g.cs b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.g.cs new file mode 100644 index 00000000..aad20caa --- /dev/null +++ b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IInstanceTypeServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IJobsClient.g.cs b/src/libs/Together/Generated/Together.IJobsClient.g.cs index 68f6636d..91c5730b 100644 --- a/src/libs/Together/Generated/Together.IJobsClient.g.cs +++ b/src/libs/Together/Generated/Together.IJobsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IJobsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IModelsClient.g.cs b/src/libs/Together/Generated/Together.IModelsClient.g.cs index b268e4a7..3c3632f2 100644 --- a/src/libs/Together/Generated/Together.IModelsClient.g.cs +++ b/src/libs/Together/Generated/Together.IModelsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IModelsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs new file mode 100644 index 00000000..56ee544b --- /dev/null +++ b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IPlacementProfileServiceClient + { + /// + /// Get a placement profile
+ /// Retrieves a reusable placement profile and its ordered region preferences. + ///
+ /// + /// Project identifier. + /// + /// + /// Placement profile identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PlacementProfileServiceGetPlacementProfileAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a placement profile
+ /// Retrieves a reusable placement profile and its ordered region preferences. + ///
+ /// + /// Project identifier. + /// + /// + /// Placement profile identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PlacementProfileServiceGetPlacementProfileAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs new file mode 100644 index 00000000..2eacf5b3 --- /dev/null +++ b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IPlacementProfileServiceClient + { + /// + /// List placement profiles
+ /// Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of profiles to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous placement profile list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PlacementProfileServiceListPlacementProfilesAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List placement profiles
+ /// Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of profiles to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous placement profile list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PlacementProfileServiceListPlacementProfilesAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.g.cs b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.g.cs new file mode 100644 index 00000000..2f31693c --- /dev/null +++ b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IPlacementProfileServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs b/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs new file mode 100644 index 00000000..29516bca --- /dev/null +++ b/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs @@ -0,0 +1,48 @@ +#nullable enable + +namespace Together +{ + public partial interface IQueueClient + { + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ClearQueueAsync( + + global::Together.QueueClearRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ClearQueueAsResponseAsync( + + global::Together.QueueClearRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Model identifier whose pending jobs should be canceled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ClearQueueAsync( + string model, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs b/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs index 8a1a04d3..31931478 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs @@ -44,12 +44,13 @@ public partial interface IQueueClient /// or cancel the job. /// /// - /// Arbitrary JSON metadata stored with the job and returned in status
- /// responses. The model and system may add or update keys during
- /// processing. + /// Arbitrary JSON metadata stored with the job. Returned in status
+ /// responses, where the model and system may have added or modified
+ /// keys (e.g. progress). /// /// - /// Required model identifier + /// Required model identifier
+ /// Example: my-queue-model /// /// /// Freeform model input. Passed unchanged to the model. Contents are model-specific. diff --git a/src/libs/Together/Generated/Together.IQueueClient.g.cs b/src/libs/Together/Generated/Together.IQueueClient.g.cs index 60f222a7..e413445c 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.g.cs @@ -19,6 +19,27 @@ public partial interface IQueueClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs b/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs index 4f8351ae..d52c0f6d 100644 --- a/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRegionServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs index c250d133..c6c834d5 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs @@ -23,7 +23,7 @@ public partial interface IRemediationServiceClient string instanceId, string remediationId, - global::Together.CommentBody request, + global::Together.ApproveRemediationRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -45,7 +45,7 @@ public partial interface IRemediationServiceClient string instanceId, string remediationId, - global::Together.CommentBody request, + global::Together.ApproveRemediationRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -59,7 +59,15 @@ public partial interface IRemediationServiceClient /// /// /// - /// Comment explaining the action. + /// Approval comment explaining the decision. + /// + /// + /// Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
+ /// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
+ /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -69,6 +77,7 @@ public partial interface IRemediationServiceClient string instanceId, string remediationId, string? comment = default, + global::Together.ApproveRemediationRequestMode? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs index 4418763b..6353443b 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs @@ -67,7 +67,10 @@ public partial interface IRemediationServiceClient /// /// Remediation mode specifies how the remediation should be performed.
/// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
- /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. /// /// /// User-provided reason for the remediation. diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs index a1919c1c..fa22fb15 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs @@ -5,6 +5,7 @@ namespace Together public partial interface IRemediationServiceClient { /// + /// List remediations
/// Lists remediations for an instance or cluster. ///
/// @@ -26,27 +27,22 @@ public partial interface IRemediationServiceClient /// - `SUCCEEDED`: Successfully completed.
/// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
- /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation. /// /// /// Order by expression. /// + /// + /// Filter by trigger type(s). Returns remediations matching any of the specified triggers. + /// /// - /// Filter by remediation mode. Returns only remediations matching the specified mode. + /// Filter by remediation mode(s). Returns remediations matching any of the specified modes. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - /// - /// import together
- /// client = together.Together(api_key="your_api_key")
- /// remediations = client.beta.clusters.remediations.list(
- /// cluster_id="cluster_id",
- /// instance_id="-",
- /// )
- /// for remediation in remediations:
- /// print(remediation) - ///
global::System.Threading.Tasks.Task RemediationServiceListRemediationsAsync( string clusterId, string instanceId, @@ -54,10 +50,12 @@ public partial interface IRemediationServiceClient string? pageToken = default, global::System.Collections.Generic.IList? state = default, string? orderBy = default, - global::Together.RemediationServiceListRemediationsMode? mode = default, + global::System.Collections.Generic.IList? trigger = default, + global::System.Collections.Generic.IList? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// + /// List remediations
/// Lists remediations for an instance or cluster. ///
/// @@ -79,27 +77,22 @@ public partial interface IRemediationServiceClient /// - `SUCCEEDED`: Successfully completed.
/// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
- /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation. /// /// /// Order by expression. /// + /// + /// Filter by trigger type(s). Returns remediations matching any of the specified triggers. + /// /// - /// Filter by remediation mode. Returns only remediations matching the specified mode. + /// Filter by remediation mode(s). Returns remediations matching any of the specified modes. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - /// - /// import together
- /// client = together.Together(api_key="your_api_key")
- /// remediations = client.beta.clusters.remediations.list(
- /// cluster_id="cluster_id",
- /// instance_id="-",
- /// )
- /// for remediation in remediations:
- /// print(remediation) - ///
global::System.Threading.Tasks.Task> RemediationServiceListRemediationsAsResponseAsync( string clusterId, string instanceId, @@ -107,7 +100,8 @@ public partial interface IRemediationServiceClient string? pageToken = default, global::System.Collections.Generic.IList? state = default, string? orderBy = default, - global::Together.RemediationServiceListRemediationsMode? mode = default, + global::System.Collections.Generic.IList? trigger = default, + global::System.Collections.Generic.IList? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs index 6e546e80..4a7950c0 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRemediationServiceClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRerankClient.g.cs b/src/libs/Together/Generated/Together.IRerankClient.g.cs index 6ac3ded4..b4441f5f 100644 --- a/src/libs/Together/Generated/Together.IRerankClient.g.cs +++ b/src/libs/Together/Generated/Together.IRerankClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRerankClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs new file mode 100644 index 00000000..bb5bf168 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateModelResourcesAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateModelResourcesAsResponseAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout to provision. + /// + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Optimizer configuration for this resource. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateModelResourcesAsync( + string baseModel, + global::Together.RlComputeConfigCreateRequest? computeConfig = default, + bool? loraEnabled = default, + global::Together.RlOptimizerConfig? optimizerConfig = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs b/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs new file mode 100644 index 00000000..e4e61cbf --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs @@ -0,0 +1,64 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session 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 CustomForwardBackwardAsync( + string sessionId, + + global::Together.RlCustomForwardBackwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session 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> CustomForwardBackwardAsResponseAsync( + string sessionId, + + global::Together.RlCustomForwardBackwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session ID + /// + /// + /// Batch of training samples + /// + /// + /// Per-sample per-token gradients of the loss with respect to log-probabilities + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CustomForwardBackwardAsync( + string sessionId, + global::System.Collections.Generic.IList samples, + global::System.Collections.Generic.IList gradients, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs b/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs new file mode 100644 index 00000000..98b9f446 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating 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 EstimateModelResourcesCostAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating 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> EstimateModelResourcesCostAsResponseAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating it. + ///
+ /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout to provision. + /// + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Optimizer configuration for this resource. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EstimateModelResourcesCostAsync( + string baseModel, + global::Together.RlComputeConfigCreateRequest? computeConfig = default, + bool? loraEnabled = default, + global::Together.RlOptimizerConfig? optimizerConfig = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.Forward.g.cs b/src/libs/Together/Generated/Together.IRlClient.Forward.g.cs new file mode 100644 index 00000000..aed21f3a --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.Forward.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session 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 ForwardAsync( + string sessionId, + + global::Together.RlForwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session 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> ForwardAsResponseAsync( + string sessionId, + + global::Together.RlForwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session ID + /// + /// + /// Batch of training samples for which to compute per-token log-probabilities + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ForwardAsync( + string sessionId, + global::System.Collections.Generic.IList samples, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs new file mode 100644 index 00000000..0f12ca27 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Get custom forward-backward operation
+ /// Retrieves the current status and result of a custom forward-backward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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 GetCustomForwardBackwardOperationAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get custom forward-backward operation
+ /// Retrieves the current status and result of a custom forward-backward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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> GetCustomForwardBackwardOperationAsResponseAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.GetForwardOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetForwardOperation.g.cs new file mode 100644 index 00000000..24fe6afe --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.GetForwardOperation.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Get forward operation
+ /// Retrieves the current status and result of a forward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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 GetForwardOperationAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get forward operation
+ /// Retrieves the current status and result of a forward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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> GetForwardOperationAsResponseAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs new file mode 100644 index 00000000..daa8fb1c --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Get model resources
+ /// Gets a model resource by its ID and returns its details. + ///
+ /// + /// ID of the model resource + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetModelResourcesAsync( + string modelResourcesId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get model resources
+ /// Gets a model resource by its ID and returns its details. + ///
+ /// + /// ID of the model resource + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetModelResourcesAsResponseAsync( + string modelResourcesId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs new file mode 100644 index 00000000..2c394c28 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// List model resources
+ /// Lists the caller's model resources. + ///
+ /// + /// Status filters. When omitted, resources in any status are returned. + /// + /// + /// Maximum number of resources to return (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for pagination + /// + /// + /// Filter resources in the current project by the creator ID. Pass "me" to show resources you created. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListModelResourcesAsync( + global::System.Collections.Generic.IList? status = default, + int? limit = default, + string? after = default, + string? createdBy = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List model resources
+ /// Lists the caller's model resources. + ///
+ /// + /// Status filters. When omitted, resources in any status are returned. + /// + /// + /// Maximum number of resources to return (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for pagination + /// + /// + /// Filter resources in the current project by the creator ID. Pass "me" to show resources you created. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListModelResourcesAsResponseAsync( + global::System.Collections.Generic.IList? status = default, + int? limit = default, + string? after = default, + string? createdBy = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs new file mode 100644 index 00000000..e48b4a67 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// List supported models
+ /// Returns the models supported by the RL service and their limits for training/sampling operations. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListSupportedModelsAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List supported models
+ /// Returns the models supported by the RL service and their limits for training/sampling operations. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListSupportedModelsAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs index 963ec65b..ef42ba7d 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs @@ -9,8 +9,7 @@ public partial interface IRlClient /// Lists all training sessions. /// /// - /// Status of the training sessions to list
- /// Default Value: TRAINING_SESSION_STATUS_UNSPECIFIED + /// Status filters. When omitted, sessions in any status are returned. /// /// /// Maximum number of sessions to return (1-100)
@@ -19,13 +18,21 @@ public partial interface IRlClient /// /// Cursor for pagination (ID of the last session from the previous page) /// + /// + /// Filter sessions by the model resource they are attached to + /// + /// + /// Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ListTrainingSessionsAsync( - global::Together.RlTrainingSessionStatus? status = default, + global::System.Collections.Generic.IList? status = default, int? limit = default, string? after = default, + string? modelResourcesId = default, + string? createdBy = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -33,8 +40,7 @@ public partial interface IRlClient /// Lists all training sessions. /// /// - /// Status of the training sessions to list
- /// Default Value: TRAINING_SESSION_STATUS_UNSPECIFIED + /// Status filters. When omitted, sessions in any status are returned. /// /// /// Maximum number of sessions to return (1-100)
@@ -43,13 +49,21 @@ public partial interface IRlClient /// /// Cursor for pagination (ID of the last session from the previous page) /// + /// + /// Filter sessions by the model resource they are attached to + /// + /// + /// Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ListTrainingSessionsAsResponseAsync( - global::Together.RlTrainingSessionStatus? status = default, + global::System.Collections.Generic.IList? status = default, int? limit = default, string? after = default, + string? modelResourcesId = default, + string? createdBy = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs b/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs index 5374c104..001b092a 100644 --- a/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs @@ -45,21 +45,30 @@ public partial interface IRlClient /// /// Training session ID /// - /// - /// Learning rate for this step.
- /// Default Value: 0.0001
- /// Example: 0.0001 + /// + /// How the trainer's updated weights are propagated to the generator after this optimizer step. See `WeightSyncType` for accepted values.
+ /// Default Value: WEIGHT_SYNC_TYPE_UNSPECIFIED + /// + /// + /// Maximum gradient norm for this step, gradients across all model parameters are clipped to this value.
+ /// Default Value: 1.0
+ /// Example: 10 /// /// - /// AdamW optimizer parameters + /// Per-step AdamW optimizer overrides. + /// + /// + /// Per-step Muon optimizer overrides /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task OptimStepAsync( string sessionId, - float? learningRate = default, + global::Together.RlWeightSyncType weightSyncType = global::Together.RlWeightSyncType.WeightSyncTypeUnspecified, + float? maxGradNorm = default, global::Together.RlAdamWOptimizerParams? adamwParams = default, + global::Together.RlMuonOptimizerParams? muonParams = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs b/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs index e965a289..155358eb 100644 --- a/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs @@ -63,7 +63,7 @@ public partial interface IRlClient string sessionId, global::System.Collections.Generic.IList prompts, global::Together.RlSamplingParams? samplingParams = default, - long? numSamples = default, + int? numSamples = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs b/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs index fde50833..6b1b74b5 100644 --- a/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs @@ -34,28 +34,28 @@ public partial interface IRlClient /// Create training session
/// Creates a training session and returns its details. /// - /// - /// Base model to use for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct - /// /// /// Checkpoint ID to resume from
/// Example: 123e4567-e89b-12d3-a456-426614174000 /// - /// - /// Type of the training session. Defaults to TRAINER_AND_GENERATOR when unspecified. TRAINER_ONLY provisions only the trainer and rejects sample requests.
- /// Default Value: SESSION_TYPE_TRAINER_AND_GENERATOR + /// + /// HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id.
+ /// Example: your-org/llama-3-8b-finetuned /// /// - /// LoRA adapter configuration + /// LoRA adapter configuration for the session + /// + /// + /// Model resource to attach the session to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task StartTrainingSessionAsync( - string baseModel, + string modelResourcesId, string? resumeFromCheckpointId = default, - global::Together.RlSessionType? type = default, + string? resumeFromHfCheckpoint = default, global::Together.RlLoraConfig? loraConfig = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs new file mode 100644 index 00000000..4f674dde --- /dev/null +++ b/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace Together +{ + public partial interface IRlClient + { + /// + /// Stop model resources
+ /// Stops every session attached to the resource and tears down its GPU pods. + ///
+ /// + /// ID of the model resource + /// + /// + /// Stop the resource even if active training sessions are attached
+ /// 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 StopModelResourcesAsync( + string modelResourcesId, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop model resources
+ /// Stops every session attached to the resource and tears down its GPU pods. + ///
+ /// + /// ID of the model resource + /// + /// + /// Stop the resource even if active training sessions are attached
+ /// 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> StopModelResourcesAsResponseAsync( + string modelResourcesId, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRlClient.g.cs b/src/libs/Together/Generated/Together.IRlClient.g.cs index 0682f79b..1022bc6f 100644 --- a/src/libs/Together/Generated/Together.IRlClient.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRlClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs new file mode 100644 index 00000000..e65678e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeCancelRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceCancelRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeCancelRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Required human-readable reason recorded in the rollout audit trail. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( + string projectId, + string endpointId, + string id, + string reason, + string? etag = default, + global::Together.DeCancelRolloutRequestDisposition? disposition = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs new file mode 100644 index 00000000..d0d1252d --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs @@ -0,0 +1,108 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( + string projectId, + string endpointId, + + global::Together.DeCreateRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceCreateRolloutAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment that traffic shifts away from. + /// + /// + /// Deployment that traffic shifts toward. + /// + /// + /// Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling. + /// + /// + /// Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling. + /// + /// + /// Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen. + /// + /// + /// Optional metric gates evaluated after each step's soak. + /// + /// + /// Optional per-step soak duration before the metric gate runs. + /// + /// + /// Optional policy for the source deployment after completion. + /// + /// + /// Optional final replica count for the source deployment after completion. + /// + /// + /// Optional final replica count for the target deployment after completion. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( + string projectId, + string endpointId, + string sourceDeploymentId, + string targetDeploymentId, + global::Together.DeCanaryConfig? canary = default, + global::Together.DeBlueGreenConfig? blueGreen = default, + global::Together.DeRollingConfig? rolling = default, + global::System.Collections.Generic.IList? metrics = default, + string? stabilizationWindow = default, + global::Together.DeCreateRolloutRequestSourceCleanup? sourceCleanup = default, + int? finalSourceReplicas = default, + int? finalTargetReplicas = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs new file mode 100644 index 00000000..dca0a263 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Delete a rollout
+ /// Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceDeleteRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a rollout
+ /// Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceDeleteRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs new file mode 100644 index 00000000..c86a3e66 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Get a rollout
+ /// Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceGetRolloutAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a rollout
+ /// Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceGetRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs new file mode 100644 index 00000000..2e9e1255 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// List endpoint rollouts
+ /// Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of rollouts to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous rollout list response. + /// + /// + /// Narrow results to active or terminal rollouts. Omit to list all rollouts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceListRolloutsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.RolloutServiceListRolloutsFilter? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List endpoint rollouts
+ /// Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of rollouts to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous rollout list response. + /// + /// + /// Narrow results to active or terminal rollouts. Omit to list all rollouts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceListRolloutsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.RolloutServiceListRolloutsFilter? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs new file mode 100644 index 00000000..1d024373 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs @@ -0,0 +1,88 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePauseRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServicePauseRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePauseRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional human-readable reason recorded on the rollout pause metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + string? reason = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs new file mode 100644 index 00000000..346d8e78 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs @@ -0,0 +1,84 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePromoteRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServicePromoteRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePromoteRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs new file mode 100644 index 00000000..9c986917 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs @@ -0,0 +1,84 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeResumeRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceResumeRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeResumeRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs new file mode 100644 index 00000000..4637d1d4 --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IRolloutServiceClient + { + /// + /// Start a rollout
+ /// Starts a pending rollout and begins its configured traffic-shifting workflow. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RolloutServiceStartRolloutAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start a rollout
+ /// Starts a pending rollout and begins its configured traffic-shifting workflow. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RolloutServiceStartRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.g.cs new file mode 100644 index 00000000..6e1c3aca --- /dev/null +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IRolloutServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ISecretsClient.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.g.cs index acef640d..855d5dc1 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.g.cs @@ -19,6 +19,27 @@ public partial interface ISecretsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs new file mode 100644 index 00000000..4c9c498d --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs @@ -0,0 +1,80 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + /// + /// Endpoint source and sampling configuration for the experiment. + /// + /// + /// Optional initial target deployments. At most 100 targets; manage later changes through the target APIs. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( + string projectId, + string endpointId, + string name, + global::Together.DeShadowExperimentSource source, + global::System.Collections.Generic.IList? targets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs new file mode 100644 index 00000000..e859350e --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceCreateTargetAsync( + string projectId, + string endpointId, + string experimentId, + + global::Together.DeCreateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + + global::Together.DeCreateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Exclude it from the endpoint's live traffic split. + /// + /// + /// Optional free-form target 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 ShadowExperimentServiceCreateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string name, + string targetDeploymentId, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs new file mode 100644 index 00000000..42817051 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Delete a shadow experiment
+ /// Deletes a shadow experiment and its target records. The underlying deployments are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a shadow experiment
+ /// Deletes a shadow experiment and its target records. The underlying deployments are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs new file mode 100644 index 00000000..c9914254 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Delete a shadow experiment target
+ /// Removes a target from a shadow experiment without deleting the underlying deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a shadow experiment target
+ /// Removes a target from a shadow experiment without deleting the underlying deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs new file mode 100644 index 00000000..842029a2 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Get a shadow experiment
+ /// Retrieves a shadow experiment, including its sampling strategy and target deployments. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceGetShadowExperimentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a shadow experiment
+ /// Retrieves a shadow experiment, including its sampling strategy and target deployments. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceGetShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs new file mode 100644 index 00000000..465b49ce --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Get a shadow experiment target
+ /// Retrieves one target configured to receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceGetTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a shadow experiment target
+ /// Retrieves one target configured to receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceGetTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs new file mode 100644 index 00000000..c947d080 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// List shadow experiments
+ /// Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of shadow experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment list response. + /// + /// + /// Whether to include target deployments in each returned shadow experiment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceListShadowExperimentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + bool? includeTargets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List shadow experiments
+ /// Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of shadow experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment list response. + /// + /// + /// Whether to include target deployments in each returned shadow experiment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceListShadowExperimentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + bool? includeTargets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs new file mode 100644 index 00000000..0353f48e --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// List shadow experiment targets
+ /// Lists the deployments that receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Maximum number of targets to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment target list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceListTargetsAsync( + string projectId, + string endpointId, + string experimentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List shadow experiment targets
+ /// Lists the deployments that receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Maximum number of targets to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment target list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceListTargetsAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs new file mode 100644 index 00000000..dc54374a --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Updated free-form description. + /// + /// + /// Updated endpoint sampling configuration. Source updates require etag in the request body. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string updateMask, + string? description = default, + global::Together.DeShadowExperimentSource? source = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs new file mode 100644 index 00000000..525d2b20 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs @@ -0,0 +1,120 @@ +#nullable enable + +namespace Together +{ + public partial interface IShadowExperimentServiceClient + { + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `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 ShadowExperimentServiceUpdateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `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> ShadowExperimentServiceUpdateTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `description`. + /// + /// + /// Updated human-readable target name. + /// + /// + /// Replacement deployment under the parent endpoint. Exclude it from the endpoint's live traffic split. + /// + /// + /// Updated free-form target description. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + string? name = default, + string? targetDeploymentId = default, + string? description = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.g.cs new file mode 100644 index 00000000..b95985c1 --- /dev/null +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IShadowExperimentServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs index 0061742a..0b0d2d44 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs @@ -70,6 +70,9 @@ public partial interface ISharedVolumeServiceClient /// /// When true, the shared volume is not deleted when the cluster is decommissioned. /// + /// + /// Project ID that will own the volume. When omitted, the caller's default project is used. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -78,6 +81,7 @@ public partial interface ISharedVolumeServiceClient long sizeTib, string region, bool? isLifecycleIndependent = default, + string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs index 09bbc675..02987e3a 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface ISharedVolumeServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs new file mode 100644 index 00000000..3a76dff5 --- /dev/null +++ b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Together +{ + public partial interface ISupportedModelsServiceClient + { + /// + /// Get a supported model
+ /// Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. + ///
+ /// + /// Supported model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SupportedModelsServiceGetSupportedModelAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a supported model
+ /// Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. + ///
+ /// + /// Supported model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SupportedModelsServiceGetSupportedModelAsResponseAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs new file mode 100644 index 00000000..100a87f3 --- /dev/null +++ b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface ISupportedModelsServiceClient + { + /// + /// List supported models
+ /// Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. + ///
+ /// + /// Filter models by input modality. + /// + /// + /// Filter models by product surface. + /// + /// + /// Case-insensitive search across model IDs, names, and descriptions. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous supported-model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SupportedModelsServiceListSupportedModelsAsync( + global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, + global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, + string? search = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List supported models
+ /// Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. + ///
+ /// + /// Filter models by input modality. + /// + /// + /// Filter models by product surface. + /// + /// + /// Case-insensitive search across model IDs, names, and descriptions. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous supported-model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SupportedModelsServiceListSupportedModelsAsResponseAsync( + global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, + global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, + string? search = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.g.cs b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.g.cs new file mode 100644 index 00000000..a9bcba79 --- /dev/null +++ b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ISupportedModelsServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ITogetherClient.g.cs b/src/libs/Together/Generated/Together.ITogetherClient.g.cs index 14d3868e..56f819b5 100644 --- a/src/libs/Together/Generated/Together.ITogetherClient.g.cs +++ b/src/libs/Together/Generated/Together.ITogetherClient.g.cs @@ -66,6 +66,16 @@ public partial interface ITogetherClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// + /// + public ABExperimentServiceClient ABExperimentService { get; } + + /// + /// + /// + public AccountClient Account { get; } + /// /// /// @@ -91,6 +101,16 @@ public partial interface ITogetherClient : global::System.IDisposable /// public CompletionClient Completion { get; } + /// + /// + /// + public ConfigServiceClient ConfigService { get; } + + /// + /// + /// + public DeploymentServiceClient DeploymentService { get; } + /// /// /// @@ -111,6 +131,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public EmbeddingsClient Embeddings { get; } + /// + /// + /// + public EndpointServiceClient EndpointService { get; } + /// /// /// @@ -146,6 +171,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public HardwareClient Hardware { get; } + /// + /// + /// + public HealthCheckServiceClient HealthCheckService { get; } + /// /// /// @@ -156,6 +186,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public InstanceClusterAddOnServiceClient InstanceClusterAddOnService { get; } + /// + /// + /// + public InstanceTypeServiceClient InstanceTypeService { get; } + /// /// /// @@ -166,6 +201,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public ModelsClient Models { get; } + /// + /// + /// + public PlacementProfileServiceClient PlacementProfileService { get; } + /// /// /// @@ -191,16 +231,31 @@ public partial interface ITogetherClient : global::System.IDisposable /// public RlClient Rl { get; } + /// + /// + /// + public RolloutServiceClient RolloutService { get; } + /// /// /// public SecretsClient Secrets { get; } + /// + /// + /// + public ShadowExperimentServiceClient ShadowExperimentService { get; } + /// /// /// public SharedVolumeServiceClient SharedVolumeService { get; } + /// + /// + /// + public SupportedModelsServiceClient SupportedModelsService { get; } + /// /// /// @@ -211,6 +266,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public VoicesClient Voices { get; } + /// + /// + /// + public VolumeServiceClient VolumeService { get; } + /// /// /// diff --git a/src/libs/Together/Generated/Together.IVoicesClient.g.cs b/src/libs/Together/Generated/Together.IVoicesClient.g.cs index a18bd3fd..bdefdebb 100644 --- a/src/libs/Together/Generated/Together.IVoicesClient.g.cs +++ b/src/libs/Together/Generated/Together.IVoicesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IVoicesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs new file mode 100644 index 00000000..0e1b4451 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs @@ -0,0 +1,72 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( + string projectId, + + global::Together.DeCreateModelRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceCreateModelAsResponseAsync( + string projectId, + + global::Together.DeCreateModelRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Name for the custom model. May be bare or qualified as `<project_slug>/<model_name>`; a supplied project slug must match the project in the request path. + /// + /// + /// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted. + /// + /// + /// Human-readable description of the model and its intended use. + /// + /// + /// ID of the supported base model from which this model was derived. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( + string projectId, + string name, + string type, + string baseModelId, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs new file mode 100644 index 00000000..2345a18d --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceCreateRemoteModelUploadAsync( + string projectId, + + global::Together.DeCreateRemoteUploadSpec request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceCreateRemoteModelUploadAsResponseAsync( + string projectId, + + global::Together.DeCreateRemoteUploadSpec request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// ID of the registered model that will receive the imported files. + /// + /// + /// Hugging Face repository URL or presigned archive URL to import. + /// + /// + /// Optional source credential used to access a private remote location. The value is write-only and is not 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 VolumeServiceCreateRemoteModelUploadAsync( + string projectId, + string modelId, + string remoteUrl, + string? token = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs new file mode 100644 index 00000000..7e0011b8 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Delete a model
+ /// Permanently deletes a custom model resource. The model must not be in use by an active deployment. + ///
+ /// + /// ID of the project that owns the model. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceDeleteModelAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a model
+ /// Permanently deletes a custom model resource. The model must not be in use by an active deployment. + ///
+ /// + /// ID of the project that owns the model. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceDeleteModelAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs new file mode 100644 index 00000000..38827559 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Get a model
+ /// Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceGetModelAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a model
+ /// Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceGetModelAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs new file mode 100644 index 00000000..803e12a8 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Get a remote model upload
+ /// Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceGetRemoteModelUploadAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a remote model upload
+ /// Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceGetRemoteModelUploadAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs new file mode 100644 index 00000000..8ca7f16d --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Get a model volume revision
+ /// Retrieves metadata for one immutable revision of a custom model's files. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceGetRevisionByModelTypeAsync( + string projectId, + string id, + string revisionId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a model volume revision
+ /// Retrieves metadata for one immutable revision of a custom model's files. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceGetRevisionByModelTypeAsResponseAsync( + string projectId, + string id, + string revisionId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs new file mode 100644 index 00000000..f4a50181 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List model files
+ /// Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier to read from. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListModelFilesAsync( + string projectId, + string id, + string? revisionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List model files
+ /// Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier to read from. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListModelFilesAsResponseAsync( + string projectId, + string id, + string? revisionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs new file mode 100644 index 00000000..bf016dbe --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List model revisions
+ /// Lists the immutable file revisions available for a custom model, newest first. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListModelRevisionsAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List model revisions
+ /// Lists the immutable file revisions available for a custom model, newest first. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListModelRevisionsAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs new file mode 100644 index 00000000..9c7b0169 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs @@ -0,0 +1,68 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List project models
+ /// Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. + ///
+ /// + /// Project identifier. + /// + /// + /// Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + /// + /// + /// Organization whose shared models should be included. Defaults to the authenticated project's organization. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListModelsAsync( + string projectId, + global::Together.VolumeServiceListModelsVisibility? visibility = default, + string? organizationId = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List project models
+ /// Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. + ///
+ /// + /// Project identifier. + /// + /// + /// Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + /// + /// + /// Organization whose shared models should be included. Defaults to the authenticated project's organization. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListModelsAsResponseAsync( + string projectId, + global::Together.VolumeServiceListModelsVisibility? visibility = default, + string? organizationId = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs new file mode 100644 index 00000000..05db782d --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List organization models
+ /// Lists custom models shared with every project in the specified organization. Project-private and public models are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListOrganizationModelsAsync( + string organizationId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List organization models
+ /// Lists custom models shared with every project in the specified organization. Project-private and public models are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListOrganizationModelsAsResponseAsync( + string organizationId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs new file mode 100644 index 00000000..31b68346 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List remote model upload events
+ /// Lists progress and diagnostic events for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// + /// Maximum number of events to return. + /// + /// + /// Cursor from a previous remote upload event list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadEventsAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List remote model upload events
+ /// Lists progress and diagnostic events for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// + /// Maximum number of events to return. + /// + /// + /// Cursor from a previous remote upload event list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadEventsAsResponseAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs new file mode 100644 index 00000000..f00bca14 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// List remote model uploads
+ /// Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of uploads to return. + /// + /// + /// Cursor from a previous remote upload list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadsAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List remote model uploads
+ /// Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of uploads to return. + /// + /// + /// Cursor from a previous remote upload list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadsAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs new file mode 100644 index 00000000..917ec2a3 --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs @@ -0,0 +1,93 @@ +#nullable enable + +namespace Together +{ + public partial interface IVolumeServiceClient + { + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( + string projectId, + string id, + + global::Together.DeUpdateModelRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VolumeServiceUpdateModelAsResponseAsync( + string projectId, + string id, + + global::Together.DeUpdateModelRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Updated inference-addressable model name. + /// + /// + /// Updated user-facing model description. + /// + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( + string projectId, + string id, + string? updateMask = default, + string? name = default, + string? description = default, + global::Together.DeUpdateModelRequestVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.g.cs new file mode 100644 index 00000000..31de83ad --- /dev/null +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IVolumeServiceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IVolumesClient.g.cs b/src/libs/Together/Generated/Together.IVolumesClient.g.cs index eb7ac767..107cbe26 100644 --- a/src/libs/Together/Generated/Together.IVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.IVolumesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IVolumesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs b/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs index 21acf7e5..40973065 100644 --- a/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs +++ b/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ImagesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateImagesGenerationsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateImagesGenerationsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -139,7 +152,9 @@ partial void ProcessCreateImagesGenerationsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/images/generations", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateImagesGenerationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -397,17 +412,15 @@ partial void ProcessCreateImagesGenerationsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -444,17 +457,15 @@ partial void ProcessCreateImagesGenerationsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.ImagesClient.g.cs b/src/libs/Together/Generated/Together.ImagesClient.g.cs index 6fe91d14..b78438c6 100644 --- a/src/libs/Together/Generated/Together.ImagesClient.g.cs +++ b/src/libs/Together/Generated/Together.ImagesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class ImagesClient : global::Together.IImagesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class ImagesClient : global::Together.IImagesClient, globa public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class ImagesClient : global::Together.IImagesClient, globa public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the ImagesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs index 08dbcfb3..b13dcf9b 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceCreateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_InstanceClusterAddOnServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -121,7 +134,9 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/addons", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -380,17 +395,15 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -427,17 +440,15 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -454,9 +465,15 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( /// /// The ID of the cluster to create the add-on on. /// - /// - /// - /// + /// + /// Human-readable name for this add-on instance. + /// + /// + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass', 'headlamp'. + /// + /// + /// Configuration for a cluster add-on. + /// /// 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/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs index 2a511e8f..4c6bc280 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceDeleteServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_InstanceClusterAddOnServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -373,17 +388,15 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -420,17 +433,15 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs index 809422fa..b01d542b 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceGetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_InstanceClusterAddOnServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -373,17 +388,15 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -420,17 +433,15 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs index 515b4f68..458fe632 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_InstanceClusterAddOnServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -108,7 +121,9 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/addons", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -360,17 +375,15 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -407,17 +420,15 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs index eefeb6f9..185100d7 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceUpdateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_InstanceClusterAddOnServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -133,7 +146,9 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -393,17 +408,15 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -440,17 +453,15 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -470,7 +481,9 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( /// /// The ID of the add-on to update. /// - /// + /// + /// Configuration for a cluster add-on. + /// /// 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/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs index cd589ef2..9f96ab08 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class InstanceClusterAddOnServiceClient : global::Together.IInstanceClusterAddOnServiceClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class InstanceClusterAddOnServiceClient : global::Together public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class InstanceClusterAddOnServiceClient : global::Together public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the InstanceClusterAddOnServiceClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs new file mode 100644 index 00000000..ed357559 --- /dev/null +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs @@ -0,0 +1,477 @@ + +#nullable enable + +namespace Together +{ + public partial class InstanceTypeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_InstanceTypeServiceGetInferenceInstanceTypeServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_InstanceTypeServiceGetInferenceInstanceTypeSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_InstanceTypeServiceGetInferenceInstanceTypeSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_InstanceTypeServiceGetInferenceInstanceTypeSecurityRequirement0, + }; + partial void PrepareInstanceTypeServiceGetInferenceInstanceTypeArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareInstanceTypeServiceGetInferenceInstanceTypeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get an inference instance type
+ /// Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. + ///
+ /// + /// Resource identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task InstanceTypeServiceGetInferenceInstanceTypeAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InstanceTypeServiceGetInferenceInstanceTypeAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an inference instance type
+ /// Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. + ///
+ /// + /// Resource identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> InstanceTypeServiceGetInferenceInstanceTypeAsResponseAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInstanceTypeServiceGetInferenceInstanceTypeArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_InstanceTypeServiceGetInferenceInstanceTypeSecurityRequirements, + operationName: "InstanceTypeServiceGetInferenceInstanceTypeAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/public/inference-instance-types/{id}", + baseUri: ResolveBaseUri( + servers: s_InstanceTypeServiceGetInferenceInstanceTypeServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareInstanceTypeServiceGetInferenceInstanceTypeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceGetInferenceInstanceType", + methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceGetInferenceInstanceType", + methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceGetInferenceInstanceType", + methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessInstanceTypeServiceGetInferenceInstanceTypeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceGetInferenceInstanceType", + methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceGetInferenceInstanceType", + methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeInferenceInstanceType.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeInferenceInstanceType.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs new file mode 100644 index 00000000..a275574e --- /dev/null +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs @@ -0,0 +1,464 @@ + +#nullable enable + +namespace Together +{ + public partial class InstanceTypeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_InstanceTypeServiceListInferenceInstanceTypesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_InstanceTypeServiceListInferenceInstanceTypesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_InstanceTypeServiceListInferenceInstanceTypesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_InstanceTypeServiceListInferenceInstanceTypesSecurityRequirement0, + }; + partial void PrepareInstanceTypeServiceListInferenceInstanceTypesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareInstanceTypeServiceListInferenceInstanceTypesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List inference instance types
+ /// Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task InstanceTypeServiceListInferenceInstanceTypesAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InstanceTypeServiceListInferenceInstanceTypesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List inference instance types
+ /// Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> InstanceTypeServiceListInferenceInstanceTypesAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInstanceTypeServiceListInferenceInstanceTypesArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_InstanceTypeServiceListInferenceInstanceTypesSecurityRequirements, + operationName: "InstanceTypeServiceListInferenceInstanceTypesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/public/inference-instance-types", + baseUri: ResolveBaseUri( + servers: s_InstanceTypeServiceListInferenceInstanceTypesServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareInstanceTypeServiceListInferenceInstanceTypesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceListInferenceInstanceTypes", + methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", + pathTemplate: "\"/public/inference-instance-types\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceListInferenceInstanceTypes", + methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", + pathTemplate: "\"/public/inference-instance-types\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceListInferenceInstanceTypes", + methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", + pathTemplate: "\"/public/inference-instance-types\"", + httpMethod: "GET", + 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::Together.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); + ProcessInstanceTypeServiceListInferenceInstanceTypesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceListInferenceInstanceTypes", + methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", + pathTemplate: "\"/public/inference-instance-types\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InstanceTypeServiceListInferenceInstanceTypes", + methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", + pathTemplate: "\"/public/inference-instance-types\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListInferenceInstanceTypesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListInferenceInstanceTypesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.InstanceTypeServiceClient.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs new file mode 100644 index 00000000..e3ca2445 --- /dev/null +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class InstanceTypeServiceClient : global::Together.IInstanceTypeServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the InstanceTypeServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InstanceTypeServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the InstanceTypeServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InstanceTypeServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the InstanceTypeServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InstanceTypeServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs b/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs index c3278595..d604ea31 100644 --- a/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs +++ b/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class JobsClient { + private static readonly global::Together.AutoSDKServer[] s_GetJobServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -112,7 +125,9 @@ partial void ProcessGetJobResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/jobs/{jobId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -364,17 +379,15 @@ partial void ProcessGetJobResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -411,17 +424,15 @@ partial void ProcessGetJobResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs b/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs index 1603505e..f9d6e61e 100644 --- a/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs +++ b/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class JobsClient { + private static readonly global::Together.AutoSDKServer[] s_ListJobsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ListJobsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -98,7 +111,9 @@ partial void ProcessListJobsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ListJobsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -349,17 +364,15 @@ partial void ProcessListJobsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -396,17 +409,15 @@ partial void ProcessListJobsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.JobsClient.g.cs b/src/libs/Together/Generated/Together.JobsClient.g.cs index 07bf6c9c..ceb29e84 100644 --- a/src/libs/Together/Generated/Together.JobsClient.g.cs +++ b/src/libs/Together/Generated/Together.JobsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class JobsClient : global::Together.IJobsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class JobsClient : global::Together.IJobsClient, global::S public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class JobsClient : global::Together.IJobsClient, global::S public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the JobsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestMode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestMode.g.cs new file mode 100644 index 00000000..473b0bfa --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestMode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ApproveRemediationRequestModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ApproveRemediationRequestMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ApproveRemediationRequestModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ApproveRemediationRequestMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ApproveRemediationRequestMode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ApproveRemediationRequestMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ApproveRemediationRequestModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestModeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestModeNullable.g.cs new file mode 100644 index 00000000..3a8250e8 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ApproveRemediationRequestModeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ApproveRemediationRequestModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ApproveRemediationRequestMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ApproveRemediationRequestModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ApproveRemediationRequestMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ApproveRemediationRequestMode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ApproveRemediationRequestMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ApproveRemediationRequestModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs new file mode 100644 index 00000000..9d6e36fc --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullable.g.cs new file mode 100644 index 00000000..373b840c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRole.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRole.g.cs new file mode 100644 index 00000000..58bebe30 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeABExperimentMemberRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeABExperimentMemberRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeABExperimentMemberRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeABExperimentMemberRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeABExperimentMemberRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeABExperimentMemberRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeABExperimentMemberRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRoleNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRoleNullable.g.cs new file mode 100644 index 00000000..c2cc49dc --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeABExperimentMemberRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeABExperimentMemberRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeABExperimentMemberRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeABExperimentMemberRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeABExperimentMemberRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeABExperimentMemberRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeABExperimentMemberRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeABExperimentMemberRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeAutoscalingResponse.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeAutoscalingResponse.g.cs new file mode 100644 index 00000000..44f3e6e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeAutoscalingResponse.g.cs @@ -0,0 +1,145 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class DeAutoscalingResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeAutoscalingResponse Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("maxReplicas")) __score0++; + if (__jsonProps.Contains("minReplicas")) __score0++; + if (__jsonProps.Contains("scaleDownWindow")) __score0++; + if (__jsonProps.Contains("scaleToZeroWindow")) __score0++; + if (__jsonProps.Contains("scaleUpWindow")) __score0++; + if (__jsonProps.Contains("scalingMetrics")) __score0++; + var __score1 = 0; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Together.DeAutoscaling? deAutoscaling = default; + object? deAutoscalingResponseVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeAutoscaling), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeAutoscaling).Name}"); + deAutoscaling = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + deAutoscalingResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (deAutoscaling == null && deAutoscalingResponseVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeAutoscaling), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeAutoscaling).Name}"); + deAutoscaling = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deAutoscaling == null && deAutoscalingResponseVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + deAutoscalingResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Together.DeAutoscalingResponse( + deAutoscaling, + + deAutoscalingResponseVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeAutoscalingResponse value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsDeAutoscaling) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeAutoscaling), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeAutoscaling).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeAutoscaling!, typeInfo); + } + else if (value.IsDeAutoscalingResponseVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeAutoscalingResponseVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDisposition.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDisposition.g.cs new file mode 100644 index 00000000..8cdc64b8 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDisposition.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCancelRolloutRequestDispositionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCancelRolloutRequestDisposition Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCancelRolloutRequestDispositionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCancelRolloutRequestDisposition)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCancelRolloutRequestDisposition); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCancelRolloutRequestDisposition value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeCancelRolloutRequestDispositionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDispositionNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDispositionNullable.g.cs new file mode 100644 index 00000000..6f53802a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCancelRolloutRequestDispositionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCancelRolloutRequestDispositionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCancelRolloutRequestDisposition? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCancelRolloutRequestDispositionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCancelRolloutRequestDisposition)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCancelRolloutRequestDisposition?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCancelRolloutRequestDisposition? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeCancelRolloutRequestDispositionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationType.g.cs new file mode 100644 index 00000000..9964c5f5 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCertificationCertificationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCertificationCertificationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCertificationCertificationTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCertificationCertificationType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCertificationCertificationType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCertificationCertificationType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeCertificationCertificationTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationTypeNullable.g.cs new file mode 100644 index 00000000..8e9a8c91 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationCertificationTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCertificationCertificationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCertificationCertificationType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCertificationCertificationTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCertificationCertificationType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCertificationCertificationType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCertificationCertificationType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeCertificationCertificationTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTarget.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTarget.g.cs new file mode 100644 index 00000000..9932f43d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTarget.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCertificationTargetJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCertificationTarget Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCertificationTargetExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCertificationTarget)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCertificationTarget); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCertificationTarget value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeCertificationTargetExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTargetNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTargetNullable.g.cs new file mode 100644 index 00000000..e53cbc15 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCertificationTargetNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCertificationTargetNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCertificationTarget? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCertificationTargetExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCertificationTarget)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCertificationTarget?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCertificationTarget? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeCertificationTargetExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFramework.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFramework.g.cs new file mode 100644 index 00000000..efcd7c61 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFramework.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeConfigDeploymentFrameworkJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeConfigDeploymentFramework Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeConfigDeploymentFrameworkExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeConfigDeploymentFramework)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeConfigDeploymentFramework); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeConfigDeploymentFramework value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeConfigDeploymentFrameworkExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFrameworkNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFrameworkNullable.g.cs new file mode 100644 index 00000000..f1674b5c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeConfigDeploymentFrameworkNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeConfigDeploymentFrameworkNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeConfigDeploymentFramework? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeConfigDeploymentFrameworkExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeConfigDeploymentFramework)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeConfigDeploymentFramework?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeConfigDeploymentFramework? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeConfigDeploymentFrameworkExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineType.g.cs new file mode 100644 index 00000000..e1e75ec1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeConfigEngineTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeConfigEngineType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeConfigEngineTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeConfigEngineType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeConfigEngineType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeConfigEngineType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeConfigEngineTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineTypeNullable.g.cs new file mode 100644 index 00000000..2af04ce8 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeConfigEngineTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeConfigEngineTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeConfigEngineType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeConfigEngineTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeConfigEngineType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeConfigEngineType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeConfigEngineType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeConfigEngineTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibility.g.cs new file mode 100644 index 00000000..e8fd9245 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCreateEndpointRequestVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCreateEndpointRequestVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCreateEndpointRequestVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCreateEndpointRequestVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCreateEndpointRequestVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCreateEndpointRequestVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeCreateEndpointRequestVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibilityNullable.g.cs new file mode 100644 index 00000000..7144bfaf --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCreateEndpointRequestVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCreateEndpointRequestVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCreateEndpointRequestVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCreateEndpointRequestVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCreateEndpointRequestVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCreateEndpointRequestVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCreateEndpointRequestVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeCreateEndpointRequestVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanup.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanup.g.cs new file mode 100644 index 00000000..7c0b8050 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanup.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCreateRolloutRequestSourceCleanupJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCreateRolloutRequestSourceCleanup Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCreateRolloutRequestSourceCleanupExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCreateRolloutRequestSourceCleanup)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCreateRolloutRequestSourceCleanup); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCreateRolloutRequestSourceCleanup value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeCreateRolloutRequestSourceCleanupExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullable.g.cs new file mode 100644 index 00000000..adf9da11 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeCreateRolloutRequestSourceCleanupNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeCreateRolloutRequestSourceCleanup? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeCreateRolloutRequestSourceCleanupExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeCreateRolloutRequestSourceCleanup)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeCreateRolloutRequestSourceCleanup?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeCreateRolloutRequestSourceCleanup? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeCreateRolloutRequestSourceCleanupExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusState.g.cs new file mode 100644 index 00000000..a6536305 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentAdapterStatusStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentAdapterStatusState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentAdapterStatusStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentAdapterStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentAdapterStatusState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentAdapterStatusState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeDeploymentAdapterStatusStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusStateNullable.g.cs new file mode 100644 index 00000000..071e7f86 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentAdapterStatusStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentAdapterStatusStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentAdapterStatusState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentAdapterStatusStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentAdapterStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentAdapterStatusState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentAdapterStatusState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeDeploymentAdapterStatusStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusState.g.cs new file mode 100644 index 00000000..7970cab1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentStatusStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentStatusState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentStatusStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentStatusState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentStatusState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeDeploymentStatusStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusStateNullable.g.cs new file mode 100644 index 00000000..2ce798ac --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentStatusStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentStatusStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentStatusState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentStatusStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentStatusState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentStatusState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeDeploymentStatusStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryState.g.cs new file mode 100644 index 00000000..cc120eba --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentSummaryStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentSummaryState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentSummaryStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentSummaryState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentSummaryState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentSummaryState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeDeploymentSummaryStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryStateNullable.g.cs new file mode 100644 index 00000000..b8c205ba --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentSummaryStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentSummaryState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentSummaryStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentSummaryState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentSummaryState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentSummaryState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeDeploymentSummaryStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficMode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficMode.g.cs new file mode 100644 index 00000000..f28b68a2 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficMode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentSummaryTrafficModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentSummaryTrafficMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentSummaryTrafficModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentSummaryTrafficMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentSummaryTrafficMode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentSummaryTrafficMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeDeploymentSummaryTrafficModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficModeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficModeNullable.g.cs new file mode 100644 index 00000000..c47c4136 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentSummaryTrafficModeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentSummaryTrafficModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentSummaryTrafficMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentSummaryTrafficModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentSummaryTrafficMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentSummaryTrafficMode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentSummaryTrafficMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeDeploymentSummaryTrafficModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficMode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficMode.g.cs new file mode 100644 index 00000000..2b62b882 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficMode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentTrafficModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentTrafficMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentTrafficModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentTrafficMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentTrafficMode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentTrafficMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeDeploymentTrafficModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficModeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficModeNullable.g.cs new file mode 100644 index 00000000..d0c2de69 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeDeploymentTrafficModeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeDeploymentTrafficModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeDeploymentTrafficMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeDeploymentTrafficModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeDeploymentTrafficMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeDeploymentTrafficMode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeDeploymentTrafficMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeDeploymentTrafficModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointType.g.cs new file mode 100644 index 00000000..100c40e6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEndpointTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEndpointType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEndpointTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEndpointType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEndpointType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEndpointType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeEndpointEndpointTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointTypeNullable.g.cs new file mode 100644 index 00000000..f4b8c944 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEndpointTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEndpointTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEndpointType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEndpointTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEndpointType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEndpointType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEndpointType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeEndpointEndpointTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevel.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevel.g.cs new file mode 100644 index 00000000..81c867ba --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEventLevelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEventLevel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEventLevelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEventLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEventLevel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEventLevel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeEndpointEventLevelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevelNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevelNullable.g.cs new file mode 100644 index 00000000..7eeb855d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventLevelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEventLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEventLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEventLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEventLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEventLevel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEventLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeEndpointEventLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKind.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKind.g.cs new file mode 100644 index 00000000..eb7b7a58 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKind.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEventSourceKindJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEventSourceKind Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEventSourceKindExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEventSourceKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEventSourceKind); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEventSourceKind value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeEndpointEventSourceKindExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKindNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKindNullable.g.cs new file mode 100644 index 00000000..0a1d7285 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointEventSourceKindNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointEventSourceKindNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointEventSourceKind? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointEventSourceKindExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointEventSourceKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointEventSourceKind?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointEventSourceKind? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeEndpointEventSourceKindExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibility.g.cs new file mode 100644 index 00000000..50ff5161 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointUpdateVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointUpdateVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointUpdateVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointUpdateVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointUpdateVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointUpdateVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeEndpointUpdateVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibilityNullable.g.cs new file mode 100644 index 00000000..c058fce9 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointUpdateVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointUpdateVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointUpdateVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointUpdateVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointUpdateVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointUpdateVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointUpdateVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeEndpointUpdateVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibility.g.cs new file mode 100644 index 00000000..ffbc3ba1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeEndpointVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibilityNullable.g.cs new file mode 100644 index 00000000..979efcc4 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeEndpointVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeEndpointVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeEndpointVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeEndpointVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeEndpointVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeEndpointVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeEndpointVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeEndpointVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelation.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelation.g.cs new file mode 100644 index 00000000..89d67486 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeHeadroomRelationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeHeadroomRelation Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeHeadroomRelationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeHeadroomRelation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeHeadroomRelation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeHeadroomRelation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeHeadroomRelationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelationNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelationNullable.g.cs new file mode 100644 index 00000000..81726dac --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeHeadroomRelationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeHeadroomRelationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeHeadroomRelation? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeHeadroomRelationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeHeadroomRelation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeHeadroomRelation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeHeadroomRelation? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeHeadroomRelationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraint.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraint.g.cs new file mode 100644 index 00000000..d9cca3a4 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraint.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeInlinePlacementConstraintJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeInlinePlacementConstraint Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeInlinePlacementConstraintExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeInlinePlacementConstraint)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeInlinePlacementConstraint); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeInlinePlacementConstraint value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeInlinePlacementConstraintExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraintNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraintNullable.g.cs new file mode 100644 index 00000000..92fa95ae --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeInlinePlacementConstraintNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeInlinePlacementConstraintNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeInlinePlacementConstraint? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeInlinePlacementConstraintExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeInlinePlacementConstraint)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeInlinePlacementConstraint?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeInlinePlacementConstraint? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeInlinePlacementConstraintExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatus.g.cs new file mode 100644 index 00000000..06af061f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeListRevisionsResponseRevisionValidationStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeListRevisionsResponseRevisionValidationStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeListRevisionsResponseRevisionValidationStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeListRevisionsResponseRevisionValidationStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeListRevisionsResponseRevisionValidationStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeListRevisionsResponseRevisionValidationStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeListRevisionsResponseRevisionValidationStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullable.g.cs new file mode 100644 index 00000000..6912e275 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeListRevisionsResponseRevisionValidationStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeListRevisionsResponseRevisionValidationStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeListRevisionsResponseRevisionValidationStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeListRevisionsResponseRevisionValidationStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeListRevisionsResponseRevisionValidationStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeListRevisionsResponseRevisionValidationStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheck.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheck.g.cs new file mode 100644 index 00000000..484cb1f3 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheck.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultCheckJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultCheck Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultCheckExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultCheck)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultCheck); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultCheck value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricResultCheckExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheckNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheckNullable.g.cs new file mode 100644 index 00000000..0779c930 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultCheckNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultCheckNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultCheck? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultCheckExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultCheck)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultCheck?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultCheck? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricResultCheckExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirection.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirection.g.cs new file mode 100644 index 00000000..7a31293d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultDirection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultDirectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultDirection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultDirection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricResultDirectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirectionNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirectionNullable.g.cs new file mode 100644 index 00000000..704b91f8 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultDirectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultDirectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultDirection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultDirectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultDirection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultDirection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricResultDirectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperator.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperator.g.cs new file mode 100644 index 00000000..8b9b86c7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperator.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultOperatorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultOperator Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultOperatorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultOperator)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultOperator); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultOperator value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricResultOperatorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperatorNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperatorNullable.g.cs new file mode 100644 index 00000000..fcf9d20b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultOperatorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultOperatorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultOperator? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultOperatorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultOperator)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultOperator?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultOperator? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricResultOperatorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStat.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStat.g.cs new file mode 100644 index 00000000..7e65a53c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStat.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultStatJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultStat Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultStatExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultStat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultStat); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultStat value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricResultStatExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStatNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStatNullable.g.cs new file mode 100644 index 00000000..2133a3ad --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultStatNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultStatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultStat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultStatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultStat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultStat?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultStat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricResultStatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdict.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdict.g.cs new file mode 100644 index 00000000..22638182 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdict.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultVerdictJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultVerdict Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultVerdictExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultVerdict)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultVerdict); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultVerdict value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricResultVerdictExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdictNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdictNullable.g.cs new file mode 100644 index 00000000..db36dcfe --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricResultVerdictNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricResultVerdictNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricResultVerdict? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricResultVerdictExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricResultVerdict)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricResultVerdict?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricResultVerdict? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricResultVerdictExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStat.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStat.g.cs new file mode 100644 index 00000000..056d406e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStat.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricRuleStatJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricRuleStat Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricRuleStatExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricRuleStat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricRuleStat); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricRuleStat value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeMetricRuleStatExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStatNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStatNullable.g.cs new file mode 100644 index 00000000..08999524 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeMetricRuleStatNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeMetricRuleStatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeMetricRuleStat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeMetricRuleStatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeMetricRuleStat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeMetricRuleStat?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeMetricRuleStat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeMetricRuleStatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibility.g.cs new file mode 100644 index 00000000..75b0c345 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeModelVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibilityNullable.g.cs new file mode 100644 index 00000000..b0cfff01 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeModelVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorType.g.cs new file mode 100644 index 00000000..3cb25d3a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsDraftSpeculatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsDraftSpeculatorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsDraftSpeculatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsDraftSpeculatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsDraftSpeculatorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsDraftSpeculatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeModelWeightsDraftSpeculatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullable.g.cs new file mode 100644 index 00000000..f369ca40 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsDraftSpeculatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsDraftSpeculatorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsDraftSpeculatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsDraftSpeculatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsDraftSpeculatorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsDraftSpeculatorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeModelWeightsDraftSpeculatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanism.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanism.g.cs new file mode 100644 index 00000000..6c1a55ad --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanism.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsSpeculatorMechanismJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsSpeculatorMechanism Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsSpeculatorMechanismExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsSpeculatorMechanism)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsSpeculatorMechanism); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsSpeculatorMechanism value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeModelWeightsSpeculatorMechanismExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullable.g.cs new file mode 100644 index 00000000..6fff4932 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsSpeculatorMechanismNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsSpeculatorMechanism? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsSpeculatorMechanismExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsSpeculatorMechanism)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsSpeculatorMechanism?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsSpeculatorMechanism? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeModelWeightsSpeculatorMechanismExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsType.g.cs new file mode 100644 index 00000000..6783e27b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeModelWeightsTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsTypeNullable.g.cs new file mode 100644 index 00000000..b2ecb9e0 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeModelWeightsTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeModelWeightsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeModelWeightsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeModelWeightsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeModelWeightsType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeModelWeightsType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeModelWeightsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeModelWeightsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DePlacement.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DePlacement.g.cs new file mode 100644 index 00000000..e4fd306f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DePlacement.g.cs @@ -0,0 +1,141 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class DePlacementJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DePlacement Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("inline")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("profile")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Together.DePlacementVariant1? dePlacementVariant1 = default; + global::Together.DePlacementVariant2? dePlacementVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant1).Name}"); + dePlacementVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant2).Name}"); + dePlacementVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (dePlacementVariant1 == null && dePlacementVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant1).Name}"); + dePlacementVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (dePlacementVariant1 == null && dePlacementVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant2).Name}"); + dePlacementVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Together.DePlacement( + dePlacementVariant1, + + dePlacementVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DePlacement value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsDePlacementVariant1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DePlacementVariant1!, typeInfo); + } + else if (value.IsDePlacementVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DePlacementVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DePlacementVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DePlacementVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirection.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirection.g.cs new file mode 100644 index 00000000..7df0ba2b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRegressionCheckDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRegressionCheckDirection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRegressionCheckDirectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRegressionCheckDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRegressionCheckDirection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRegressionCheckDirection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRegressionCheckDirectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirectionNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirectionNullable.g.cs new file mode 100644 index 00000000..a49a72bb --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRegressionCheckDirectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRegressionCheckDirectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRegressionCheckDirection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRegressionCheckDirectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRegressionCheckDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRegressionCheckDirection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRegressionCheckDirection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRegressionCheckDirectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevel.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevel.g.cs new file mode 100644 index 00000000..d34fc34f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRemoteUploadEventLevelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRemoteUploadEventLevel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRemoteUploadEventLevelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRemoteUploadEventLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRemoteUploadEventLevel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRemoteUploadEventLevel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRemoteUploadEventLevelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevelNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevelNullable.g.cs new file mode 100644 index 00000000..483fc07a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadEventLevelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRemoteUploadEventLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRemoteUploadEventLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRemoteUploadEventLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRemoteUploadEventLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRemoteUploadEventLevel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRemoteUploadEventLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRemoteUploadEventLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatus.g.cs new file mode 100644 index 00000000..26010299 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRemoteUploadStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRemoteUploadStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRemoteUploadStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRemoteUploadStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRemoteUploadStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRemoteUploadStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRemoteUploadStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatusNullable.g.cs new file mode 100644 index 00000000..02944376 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRemoteUploadStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRemoteUploadStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRemoteUploadStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRemoteUploadStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRemoteUploadStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRemoteUploadStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRemoteUploadStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRemoteUploadStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategory.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategory.g.cs new file mode 100644 index 00000000..1b5e724f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategory.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutConditionCategoryJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutConditionCategory Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutConditionCategoryExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutConditionCategory)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutConditionCategory); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutConditionCategory value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRolloutConditionCategoryExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategoryNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategoryNullable.g.cs new file mode 100644 index 00000000..121139f7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutConditionCategoryNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutConditionCategoryNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutConditionCategory? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutConditionCategoryExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutConditionCategory)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutConditionCategory?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutConditionCategory? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRolloutConditionCategoryExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlSessionType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutState.g.cs similarity index 69% rename from src/libs/Together/Generated/Together.JsonConverters.RlSessionType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.DeRolloutState.g.cs index 38e7e3ed..167c6f4c 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.RlSessionType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutState.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class RlSessionTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class DeRolloutStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.RlSessionType Read( + public override global::Together.DeRolloutState Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RlSessionTypeJsonConverter : global::System.Text.Json.Serial var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.RlSessionTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.DeRolloutStateExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class RlSessionTypeJsonConverter : global::System.Text.Json.Serial case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.RlSessionType)numValue; + return (global::Together.DeRolloutState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.RlSessionType); + return default(global::Together.DeRolloutState); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class RlSessionTypeJsonConverter : global::System.Text.Json.Serial /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.RlSessionType value, + global::Together.DeRolloutState value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.RlSessionTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.DeRolloutStateExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlSessionTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStateNullable.g.cs similarity index 71% rename from src/libs/Together/Generated/Together.JsonConverters.RlSessionTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.DeRolloutStateNullable.g.cs index 9b0cb954..81e2fcc4 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.RlSessionTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStateNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class RlSessionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class DeRolloutStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.RlSessionType? Read( + public override global::Together.DeRolloutState? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RlSessionTypeNullableJsonConverter : global::System.Text.Jso var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.RlSessionTypeExtensions.ToEnum(stringValue); + return global::Together.DeRolloutStateExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class RlSessionTypeNullableJsonConverter : global::System.Text.Jso case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.RlSessionType)numValue; + return (global::Together.DeRolloutState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.RlSessionType?); + return default(global::Together.DeRolloutState?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class RlSessionTypeNullableJsonConverter : global::System.Text.Jso /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.RlSessionType? value, + global::Together.DeRolloutState? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.RlSessionTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.DeRolloutStateExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusState.g.cs new file mode 100644 index 00000000..2fe948bd --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutStepStatusStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutStepStatusState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutStepStatusStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutStepStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutStepStatusState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutStepStatusState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRolloutStepStatusStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusStateNullable.g.cs new file mode 100644 index 00000000..b386b1d0 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStepStatusStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutStepStatusStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutStepStatusState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutStepStatusStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutStepStatusState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutStepStatusState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutStepStatusState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRolloutStepStatusStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategy.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategy.g.cs new file mode 100644 index 00000000..6a60e2c0 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategy.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutStrategyJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutStrategy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutStrategyExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutStrategy)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutStrategy); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutStrategy value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeRolloutStrategyExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategyNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategyNullable.g.cs new file mode 100644 index 00000000..ced1fcb0 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeRolloutStrategyNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeRolloutStrategyNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeRolloutStrategy? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeRolloutStrategyExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeRolloutStrategy)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeRolloutStrategy?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeRolloutStrategy? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeRolloutStrategyExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricType.g.cs new file mode 100644 index 00000000..71454600 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeScalingMetricTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeScalingMetricType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeScalingMetricTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeScalingMetricType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeScalingMetricType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeScalingMetricType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeScalingMetricTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricTypeNullable.g.cs new file mode 100644 index 00000000..c5205152 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeScalingMetricTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeScalingMetricTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeScalingMetricType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeScalingMetricTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeScalingMetricType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeScalingMetricType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeScalingMetricType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeScalingMetricTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSampling.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSampling.g.cs new file mode 100644 index 00000000..353d827b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSampling.g.cs @@ -0,0 +1,229 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class DeShadowExperimentSamplingJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeShadowExperimentSampling Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("uniform")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("keyBased")) __score1++; + var __score2 = 0; + if (__jsonProps.Contains("adaptiveUniform")) __score2++; + var __score3 = 0; + if (__jsonProps.Contains("adaptiveKeyBased")) __score3++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + + global::Together.DeShadowExperimentSamplingVariant1? deShadowExperimentSamplingVariant1 = default; + global::Together.DeShadowExperimentSamplingVariant2? deShadowExperimentSamplingVariant2 = default; + global::Together.DeShadowExperimentSamplingVariant3? deShadowExperimentSamplingVariant3 = default; + global::Together.DeShadowExperimentSamplingVariant4? deShadowExperimentSamplingVariant4 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant1).Name}"); + deShadowExperimentSamplingVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant2).Name}"); + deShadowExperimentSamplingVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 2) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant3).Name}"); + deShadowExperimentSamplingVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 3) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant4).Name}"); + deShadowExperimentSamplingVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (deShadowExperimentSamplingVariant1 == null && deShadowExperimentSamplingVariant2 == null && deShadowExperimentSamplingVariant3 == null && deShadowExperimentSamplingVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant1).Name}"); + deShadowExperimentSamplingVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingVariant1 == null && deShadowExperimentSamplingVariant2 == null && deShadowExperimentSamplingVariant3 == null && deShadowExperimentSamplingVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant2).Name}"); + deShadowExperimentSamplingVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingVariant1 == null && deShadowExperimentSamplingVariant2 == null && deShadowExperimentSamplingVariant3 == null && deShadowExperimentSamplingVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant3).Name}"); + deShadowExperimentSamplingVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingVariant1 == null && deShadowExperimentSamplingVariant2 == null && deShadowExperimentSamplingVariant3 == null && deShadowExperimentSamplingVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant4).Name}"); + deShadowExperimentSamplingVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Together.DeShadowExperimentSampling( + deShadowExperimentSamplingVariant1, + + deShadowExperimentSamplingVariant2, + + deShadowExperimentSamplingVariant3, + + deShadowExperimentSamplingVariant4 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeShadowExperimentSampling value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsDeShadowExperimentSamplingVariant1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingVariant1!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingVariant2!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingVariant3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingVariant3!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingVariant4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingVariant4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingVariant4!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSamplingResponse.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSamplingResponse.g.cs new file mode 100644 index 00000000..1eff1732 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentSamplingResponse.g.cs @@ -0,0 +1,229 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class DeShadowExperimentSamplingResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeShadowExperimentSamplingResponse Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("uniform")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("keyBased")) __score1++; + var __score2 = 0; + if (__jsonProps.Contains("adaptiveUniform")) __score2++; + var __score3 = 0; + if (__jsonProps.Contains("adaptiveKeyBased")) __score3++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + + global::Together.DeShadowExperimentSamplingResponseVariant1? deShadowExperimentSamplingResponseVariant1 = default; + global::Together.DeShadowExperimentSamplingResponseVariant2? deShadowExperimentSamplingResponseVariant2 = default; + global::Together.DeShadowExperimentSamplingResponseVariant3? deShadowExperimentSamplingResponseVariant3 = default; + global::Together.DeShadowExperimentSamplingResponseVariant4? deShadowExperimentSamplingResponseVariant4 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant1).Name}"); + deShadowExperimentSamplingResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant2).Name}"); + deShadowExperimentSamplingResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 2) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant3).Name}"); + deShadowExperimentSamplingResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 3) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant4).Name}"); + deShadowExperimentSamplingResponseVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (deShadowExperimentSamplingResponseVariant1 == null && deShadowExperimentSamplingResponseVariant2 == null && deShadowExperimentSamplingResponseVariant3 == null && deShadowExperimentSamplingResponseVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant1).Name}"); + deShadowExperimentSamplingResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingResponseVariant1 == null && deShadowExperimentSamplingResponseVariant2 == null && deShadowExperimentSamplingResponseVariant3 == null && deShadowExperimentSamplingResponseVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant2).Name}"); + deShadowExperimentSamplingResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingResponseVariant1 == null && deShadowExperimentSamplingResponseVariant2 == null && deShadowExperimentSamplingResponseVariant3 == null && deShadowExperimentSamplingResponseVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant3).Name}"); + deShadowExperimentSamplingResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (deShadowExperimentSamplingResponseVariant1 == null && deShadowExperimentSamplingResponseVariant2 == null && deShadowExperimentSamplingResponseVariant3 == null && deShadowExperimentSamplingResponseVariant4 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant4).Name}"); + deShadowExperimentSamplingResponseVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Together.DeShadowExperimentSamplingResponse( + deShadowExperimentSamplingResponseVariant1, + + deShadowExperimentSamplingResponseVariant2, + + deShadowExperimentSamplingResponseVariant3, + + deShadowExperimentSamplingResponseVariant4 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeShadowExperimentSamplingResponse value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsDeShadowExperimentSamplingResponseVariant1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingResponseVariant1!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingResponseVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingResponseVariant2!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingResponseVariant3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingResponseVariant3!, typeInfo); + } + else if (value.IsDeShadowExperimentSamplingResponseVariant4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.DeShadowExperimentSamplingResponseVariant4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.DeShadowExperimentSamplingResponseVariant4!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentState.g.cs new file mode 100644 index 00000000..4cceebbc --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeShadowExperimentStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeShadowExperimentState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeShadowExperimentStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeShadowExperimentState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeShadowExperimentState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeShadowExperimentState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeShadowExperimentStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentStateNullable.g.cs new file mode 100644 index 00000000..d06546e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeShadowExperimentStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeShadowExperimentStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeShadowExperimentState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeShadowExperimentStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeShadowExperimentState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeShadowExperimentState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeShadowExperimentState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeShadowExperimentStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitie.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitie.g.cs new file mode 100644 index 00000000..73f271d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitie.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelCapabilitieJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelCapabilitie Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelCapabilitieExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelCapabilitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelCapabilitie); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelCapabilitie value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelCapabilitieExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitieNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitieNullable.g.cs new file mode 100644 index 00000000..83c75ffe --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelCapabilitieNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelCapabilitieNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelCapabilitie? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelCapabilitieExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelCapabilitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelCapabilitie?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelCapabilitie? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelCapabilitieExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeature.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeature.g.cs new file mode 100644 index 00000000..125aa44a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeature.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelFeatureJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelFeature Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelFeatureExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelFeature)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelFeature); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelFeature value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelFeatureExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeatureNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeatureNullable.g.cs new file mode 100644 index 00000000..3c57ed6e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelFeatureNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelFeatureNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelFeature? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelFeatureExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelFeature)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelFeature?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelFeature? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelFeatureExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitie.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitie.g.cs new file mode 100644 index 00000000..cccc83cb --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitie.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelInputModalitieJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelInputModalitie Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelInputModalitieExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelInputModalitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelInputModalitie); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelInputModalitie value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelInputModalitieExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitieNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitieNullable.g.cs new file mode 100644 index 00000000..0bb88626 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelInputModalitieNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelInputModalitieNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelInputModalitie? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelInputModalitieExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelInputModalitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelInputModalitie?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelInputModalitie? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelInputModalitieExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitie.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitie.g.cs new file mode 100644 index 00000000..ac366c16 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitie.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelOutputModalitieJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelOutputModalitie Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelOutputModalitieExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelOutputModalitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelOutputModalitie); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelOutputModalitie value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelOutputModalitieExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitieNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitieNullable.g.cs new file mode 100644 index 00000000..3efc8663 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelOutputModalitieNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelOutputModalitieNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelOutputModalitie? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelOutputModalitieExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelOutputModalitie)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelOutputModalitie?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelOutputModalitie? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelOutputModalitieExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProduct.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProduct.g.cs new file mode 100644 index 00000000..bd8f28bf --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProduct.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelProductJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelProduct Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelProductExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelProduct)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelProduct); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelProduct value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelProductExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProductNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProductNullable.g.cs new file mode 100644 index 00000000..84c6e017 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelProductNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelProductNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelProduct? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelProductExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelProduct)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelProduct?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelProduct? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelProductExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatus.g.cs new file mode 100644 index 00000000..507a83f6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeSupportedModelStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatusNullable.g.cs new file mode 100644 index 00000000..d4b571c9 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeSupportedModelStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeSupportedModelStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeSupportedModelStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeSupportedModelStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeSupportedModelStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeSupportedModelStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeSupportedModelStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeSupportedModelStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperator.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperator.g.cs new file mode 100644 index 00000000..f2ac9f04 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperator.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeThresholdCheckOperatorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeThresholdCheckOperator Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeThresholdCheckOperatorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeThresholdCheckOperator)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeThresholdCheckOperator); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeThresholdCheckOperator value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeThresholdCheckOperatorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperatorNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperatorNullable.g.cs new file mode 100644 index 00000000..24b24ea9 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeThresholdCheckOperatorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeThresholdCheckOperatorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeThresholdCheckOperator? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeThresholdCheckOperatorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeThresholdCheckOperator)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeThresholdCheckOperator?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeThresholdCheckOperator? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeThresholdCheckOperatorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibility.g.cs new file mode 100644 index 00000000..59f0d6c9 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeUpdateModelRequestVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeUpdateModelRequestVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeUpdateModelRequestVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeUpdateModelRequestVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeUpdateModelRequestVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeUpdateModelRequestVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DeUpdateModelRequestVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibilityNullable.g.cs new file mode 100644 index 00000000..aa853579 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DeUpdateModelRequestVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DeUpdateModelRequestVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DeUpdateModelRequestVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DeUpdateModelRequestVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DeUpdateModelRequestVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DeUpdateModelRequestVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DeUpdateModelRequestVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DeUpdateModelRequestVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevel.g.cs b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevel.g.cs new file mode 100644 index 00000000..5edb576d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class EndpointServiceListEndpointEventsMinLevelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.EndpointServiceListEndpointEventsMinLevel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.EndpointServiceListEndpointEventsMinLevelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.EndpointServiceListEndpointEventsMinLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.EndpointServiceListEndpointEventsMinLevel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.EndpointServiceListEndpointEventsMinLevel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.EndpointServiceListEndpointEventsMinLevelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullable.g.cs new file mode 100644 index 00000000..320b1d1d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class EndpointServiceListEndpointEventsMinLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.EndpointServiceListEndpointEventsMinLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.EndpointServiceListEndpointEventsMinLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.EndpointServiceListEndpointEventsMinLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.EndpointServiceListEndpointEventsMinLevel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.EndpointServiceListEndpointEventsMinLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.EndpointServiceListEndpointEventsMinLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKind.g.cs b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKind.g.cs new file mode 100644 index 00000000..90a9d1d6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKind.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class EndpointServiceListEndpointEventsSourceKindJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.EndpointServiceListEndpointEventsSourceKind Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.EndpointServiceListEndpointEventsSourceKindExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.EndpointServiceListEndpointEventsSourceKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.EndpointServiceListEndpointEventsSourceKind); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.EndpointServiceListEndpointEventsSourceKind value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.EndpointServiceListEndpointEventsSourceKindExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullable.g.cs new file mode 100644 index 00000000..940327e6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class EndpointServiceListEndpointEventsSourceKindNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.EndpointServiceListEndpointEventsSourceKind? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.EndpointServiceListEndpointEventsSourceKindExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.EndpointServiceListEndpointEventsSourceKind)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.EndpointServiceListEndpointEventsSourceKind?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.EndpointServiceListEndpointEventsSourceKind? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.EndpointServiceListEndpointEventsSourceKindExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatus.g.cs new file mode 100644 index 00000000..de328b14 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FileProcessingStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FileProcessingStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FileProcessingStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FileProcessingStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FileProcessingStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FileProcessingStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.FileProcessingStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatusNullable.g.cs new file mode 100644 index 00000000..783c11ba --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FileProcessingStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FileProcessingStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FileProcessingStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FileProcessingStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FileProcessingStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FileProcessingStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FileProcessingStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.FileProcessingStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorType.g.cs new file mode 100644 index 00000000..74ad9ea4 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FileValidationReportErrorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FileValidationReportErrorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FileValidationReportErrorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FileValidationReportErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FileValidationReportErrorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FileValidationReportErrorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.FileValidationReportErrorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorTypeNullable.g.cs new file mode 100644 index 00000000..1f61306c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FileValidationReportErrorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FileValidationReportErrorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FileValidationReportErrorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FileValidationReportErrorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FileValidationReportErrorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FileValidationReportErrorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FileValidationReportErrorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.FileValidationReportErrorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpoint.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpoint.g.cs new file mode 100644 index 00000000..22ee41df --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpoint.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTuneCheckpointCheckpointJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTuneCheckpointCheckpoint Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTuneCheckpointCheckpointExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTuneCheckpointCheckpoint)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTuneCheckpointCheckpoint); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTuneCheckpointCheckpoint value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.FineTuneCheckpointCheckpointExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpointNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpointNullable.g.cs new file mode 100644 index 00000000..d3ee27d3 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTuneCheckpointCheckpointNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTuneCheckpointCheckpointNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTuneCheckpointCheckpoint? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTuneCheckpointCheckpointExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTuneCheckpointCheckpoint)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTuneCheckpointCheckpoint?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTuneCheckpointCheckpoint? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.FineTuneCheckpointCheckpointExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethod.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethod.g.cs new file mode 100644 index 00000000..50af7158 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethod.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTunePreviewRequestTrainingMethodJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTunePreviewRequestTrainingMethod Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTunePreviewRequestTrainingMethodExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTunePreviewRequestTrainingMethod)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTunePreviewRequestTrainingMethod); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTunePreviewRequestTrainingMethod value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.FineTunePreviewRequestTrainingMethodExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullable.g.cs new file mode 100644 index 00000000..b84ee481 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTunePreviewRequestTrainingMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTunePreviewRequestTrainingMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTunePreviewRequestTrainingMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTunePreviewRequestTrainingMethod)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTunePreviewRequestTrainingMethod?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTunePreviewRequestTrainingMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.FineTunePreviewRequestTrainingMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormat.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormat.g.cs new file mode 100644 index 00000000..16ee42d6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormat.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTunePreviewResponseDatasetFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTunePreviewResponseDatasetFormat Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTunePreviewResponseDatasetFormatExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTunePreviewResponseDatasetFormat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTunePreviewResponseDatasetFormat); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTunePreviewResponseDatasetFormat value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.FineTunePreviewResponseDatasetFormatExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullable.g.cs new file mode 100644 index 00000000..ec27e5d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class FineTunePreviewResponseDatasetFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.FineTunePreviewResponseDatasetFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.FineTunePreviewResponseDatasetFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.FineTunePreviewResponseDatasetFormat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.FineTunePreviewResponseDatasetFormat?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.FineTunePreviewResponseDatasetFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.FineTunePreviewResponseDatasetFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs new file mode 100644 index 00000000..fafd3c6c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullable.g.cs new file mode 100644 index 00000000..0f8a025c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs new file mode 100644 index 00000000..bad7f1c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullable.g.cs new file mode 100644 index 00000000..98725706 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatu.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatu.g.cs new file mode 100644 index 00000000..56ff14ed --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatu.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListModelResourcesStatuJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListModelResourcesStatu Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListModelResourcesStatuExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListModelResourcesStatu)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListModelResourcesStatu); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListModelResourcesStatu value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ListModelResourcesStatuExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatuNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatuNullable.g.cs new file mode 100644 index 00000000..a4f4e29b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListModelResourcesStatuNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListModelResourcesStatuNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListModelResourcesStatu? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListModelResourcesStatuExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListModelResourcesStatu)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListModelResourcesStatu?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListModelResourcesStatu? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ListModelResourcesStatuExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatu.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatu.g.cs new file mode 100644 index 00000000..b7b2d789 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatu.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListTrainingSessionsStatuJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListTrainingSessionsStatu Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListTrainingSessionsStatuExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListTrainingSessionsStatu)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListTrainingSessionsStatu); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListTrainingSessionsStatu value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ListTrainingSessionsStatuExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatuNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatuNullable.g.cs new file mode 100644 index 00000000..f34bd89b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListTrainingSessionsStatuNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListTrainingSessionsStatuNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListTrainingSessionsStatu? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListTrainingSessionsStatuExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListTrainingSessionsStatu)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListTrainingSessionsStatu?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListTrainingSessionsStatu? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ListTrainingSessionsStatuExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverity.g.cs b/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverity.g.cs new file mode 100644 index 00000000..1f46051e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverity.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class PassiveHealthCheckAlertSeverityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.PassiveHealthCheckAlertSeverity Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.PassiveHealthCheckAlertSeverityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.PassiveHealthCheckAlertSeverity)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.PassiveHealthCheckAlertSeverity); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.PassiveHealthCheckAlertSeverity value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.PassiveHealthCheckAlertSeverityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverityNullable.g.cs new file mode 100644 index 00000000..14289d31 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.PassiveHealthCheckAlertSeverityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class PassiveHealthCheckAlertSeverityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.PassiveHealthCheckAlertSeverity? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.PassiveHealthCheckAlertSeverityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.PassiveHealthCheckAlertSeverity)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.PassiveHealthCheckAlertSeverity?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.PassiveHealthCheckAlertSeverity? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.PassiveHealthCheckAlertSeverityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsMode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItem.g.cs similarity index 80% rename from src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsMode.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItem.g.cs index 9b4a9f97..c4b3dd06 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsMode.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItem.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class RemediationServiceListRemediationsModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RemediationServiceListRemediationsModeItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.RemediationServiceListRemediationsMode Read( + public override global::Together.RemediationServiceListRemediationsModeItem Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RemediationServiceListRemediationsModeJsonConverter : global var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.RemediationServiceListRemediationsModeExtensions.ToEnum(stringValue) ?? default; + return global::Together.RemediationServiceListRemediationsModeItemExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class RemediationServiceListRemediationsModeJsonConverter : global case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.RemediationServiceListRemediationsMode)numValue; + return (global::Together.RemediationServiceListRemediationsModeItem)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.RemediationServiceListRemediationsMode); + return default(global::Together.RemediationServiceListRemediationsModeItem); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class RemediationServiceListRemediationsModeJsonConverter : global /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.RemediationServiceListRemediationsMode value, + global::Together.RemediationServiceListRemediationsModeItem value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.RemediationServiceListRemediationsModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.RemediationServiceListRemediationsModeItemExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItemNullable.g.cs similarity index 81% rename from src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItemNullable.g.cs index f38b1d3b..8d3011de 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsModeItemNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class RemediationServiceListRemediationsModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RemediationServiceListRemediationsModeItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.RemediationServiceListRemediationsMode? Read( + public override global::Together.RemediationServiceListRemediationsModeItem? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class RemediationServiceListRemediationsModeNullableJsonConverter var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.RemediationServiceListRemediationsModeExtensions.ToEnum(stringValue); + return global::Together.RemediationServiceListRemediationsModeItemExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class RemediationServiceListRemediationsModeNullableJsonConverter case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.RemediationServiceListRemediationsMode)numValue; + return (global::Together.RemediationServiceListRemediationsModeItem)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.RemediationServiceListRemediationsMode?); + return default(global::Together.RemediationServiceListRemediationsModeItem?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class RemediationServiceListRemediationsModeNullableJsonConverter /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.RemediationServiceListRemediationsMode? value, + global::Together.RemediationServiceListRemediationsModeItem? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.RemediationServiceListRemediationsModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.RemediationServiceListRemediationsModeItemExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItem.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItem.g.cs new file mode 100644 index 00000000..d453d69f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItem.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RemediationServiceListRemediationsTriggerItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RemediationServiceListRemediationsTriggerItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RemediationServiceListRemediationsTriggerItemExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RemediationServiceListRemediationsTriggerItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RemediationServiceListRemediationsTriggerItem); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RemediationServiceListRemediationsTriggerItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RemediationServiceListRemediationsTriggerItemExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullable.g.cs new file mode 100644 index 00000000..6c83f50a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RemediationServiceListRemediationsTriggerItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RemediationServiceListRemediationsTriggerItem? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RemediationServiceListRemediationsTriggerItemExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RemediationServiceListRemediationsTriggerItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RemediationServiceListRemediationsTriggerItem?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RemediationServiceListRemediationsTriggerItem? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RemediationServiceListRemediationsTriggerItemExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioType.g.cs new file mode 100644 index 00000000..f34cad41 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlGRPOLossRatioTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlGRPOLossRatioType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlGRPOLossRatioTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlGRPOLossRatioType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlGRPOLossRatioType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlGRPOLossRatioType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlGRPOLossRatioTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioTypeNullable.g.cs new file mode 100644 index 00000000..73dc6af5 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlGRPOLossRatioTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlGRPOLossRatioTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlGRPOLossRatioType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlGRPOLossRatioTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlGRPOLossRatioType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlGRPOLossRatioType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlGRPOLossRatioType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlGRPOLossRatioTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCode.g.cs new file mode 100644 index 00000000..0e8961f2 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlModelResourcesErrorCodeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlModelResourcesErrorCode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlModelResourcesErrorCodeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlModelResourcesErrorCode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlModelResourcesErrorCode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlModelResourcesErrorCode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlModelResourcesErrorCodeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCodeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCodeNullable.g.cs new file mode 100644 index 00000000..8da9ce67 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesErrorCodeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlModelResourcesErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlModelResourcesErrorCode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlModelResourcesErrorCodeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlModelResourcesErrorCode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlModelResourcesErrorCode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlModelResourcesErrorCode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlModelResourcesErrorCodeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatus.g.cs new file mode 100644 index 00000000..642244fd --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlModelResourcesStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlModelResourcesStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlModelResourcesStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlModelResourcesStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlModelResourcesStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlModelResourcesStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlModelResourcesStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatusNullable.g.cs new file mode 100644 index 00000000..e53fe81e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlModelResourcesStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlModelResourcesStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlModelResourcesStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlModelResourcesStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlModelResourcesStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlModelResourcesStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlModelResourcesStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlModelResourcesStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategy.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategy.g.cs new file mode 100644 index 00000000..fdf63fbc --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategy.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlMuonScalingStrategyJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlMuonScalingStrategy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlMuonScalingStrategyExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlMuonScalingStrategy)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlMuonScalingStrategy); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlMuonScalingStrategy value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlMuonScalingStrategyExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategyNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategyNullable.g.cs new file mode 100644 index 00000000..fcd09087 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlMuonScalingStrategyNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlMuonScalingStrategyNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlMuonScalingStrategy? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlMuonScalingStrategyExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlMuonScalingStrategy)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlMuonScalingStrategy?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlMuonScalingStrategy? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlMuonScalingStrategyExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCode.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCode.g.cs new file mode 100644 index 00000000..71aa6bd1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlTrainingSessionErrorCodeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlTrainingSessionErrorCode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlTrainingSessionErrorCodeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlTrainingSessionErrorCode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlTrainingSessionErrorCode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlTrainingSessionErrorCode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlTrainingSessionErrorCodeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCodeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCodeNullable.g.cs new file mode 100644 index 00000000..a1f03e0e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlTrainingSessionErrorCodeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlTrainingSessionErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlTrainingSessionErrorCode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlTrainingSessionErrorCodeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlTrainingSessionErrorCode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlTrainingSessionErrorCode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlTrainingSessionErrorCode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlTrainingSessionErrorCodeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncType.g.cs new file mode 100644 index 00000000..42ffe50f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlWeightSyncTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlWeightSyncType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlWeightSyncTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlWeightSyncType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlWeightSyncType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlWeightSyncType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RlWeightSyncTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncTypeNullable.g.cs new file mode 100644 index 00000000..ea8eb0b0 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RlWeightSyncTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RlWeightSyncTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RlWeightSyncType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RlWeightSyncTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RlWeightSyncType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RlWeightSyncType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RlWeightSyncType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RlWeightSyncTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilter.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilter.g.cs new file mode 100644 index 00000000..c3b60d7b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilter.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RolloutServiceListRolloutsFilterJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RolloutServiceListRolloutsFilter Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RolloutServiceListRolloutsFilterExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RolloutServiceListRolloutsFilter)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RolloutServiceListRolloutsFilter); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RolloutServiceListRolloutsFilter value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.RolloutServiceListRolloutsFilterExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilterNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilterNullable.g.cs new file mode 100644 index 00000000..9ed40933 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.RolloutServiceListRolloutsFilterNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class RolloutServiceListRolloutsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.RolloutServiceListRolloutsFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.RolloutServiceListRolloutsFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.RolloutServiceListRolloutsFilter)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.RolloutServiceListRolloutsFilter?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.RolloutServiceListRolloutsFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.RolloutServiceListRolloutsFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModality.g.cs b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModality.g.cs new file mode 100644 index 00000000..22d016df --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class SupportedModelsServiceListSupportedModelsModalityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.SupportedModelsServiceListSupportedModelsModality Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.SupportedModelsServiceListSupportedModelsModalityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.SupportedModelsServiceListSupportedModelsModality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.SupportedModelsServiceListSupportedModelsModality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.SupportedModelsServiceListSupportedModelsModality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.SupportedModelsServiceListSupportedModelsModalityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullable.g.cs new file mode 100644 index 00000000..9f69f193 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.SupportedModelsServiceListSupportedModelsModality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.SupportedModelsServiceListSupportedModelsModalityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.SupportedModelsServiceListSupportedModelsModality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.SupportedModelsServiceListSupportedModelsModality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.SupportedModelsServiceListSupportedModelsModality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.SupportedModelsServiceListSupportedModelsModalityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProduct.g.cs b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProduct.g.cs new file mode 100644 index 00000000..9e38cad7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProduct.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class SupportedModelsServiceListSupportedModelsProductJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.SupportedModelsServiceListSupportedModelsProduct Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.SupportedModelsServiceListSupportedModelsProductExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.SupportedModelsServiceListSupportedModelsProduct)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.SupportedModelsServiceListSupportedModelsProduct); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.SupportedModelsServiceListSupportedModelsProduct value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.SupportedModelsServiceListSupportedModelsProductExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullable.g.cs new file mode 100644 index 00000000..7b3aa9fb --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class SupportedModelsServiceListSupportedModelsProductNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.SupportedModelsServiceListSupportedModelsProduct? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.SupportedModelsServiceListSupportedModelsProductExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.SupportedModelsServiceListSupportedModelsProduct)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.SupportedModelsServiceListSupportedModelsProduct?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.SupportedModelsServiceListSupportedModelsProduct? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.SupportedModelsServiceListSupportedModelsProductExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibility.g.cs b/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibility.g.cs new file mode 100644 index 00000000..0e5576d8 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibility.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class VolumeServiceListModelsVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.VolumeServiceListModelsVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.VolumeServiceListModelsVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.VolumeServiceListModelsVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.VolumeServiceListModelsVisibility); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.VolumeServiceListModelsVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.VolumeServiceListModelsVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibilityNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibilityNullable.g.cs new file mode 100644 index 00000000..bc203ec4 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.VolumeServiceListModelsVisibilityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class VolumeServiceListModelsVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.VolumeServiceListModelsVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.VolumeServiceListModelsVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.VolumeServiceListModelsVisibility)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.VolumeServiceListModelsVisibility?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.VolumeServiceListModelsVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.VolumeServiceListModelsVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs index d1bc9cc1..bcbc0120 100644 --- a/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs @@ -13,6 +13,206 @@ namespace Together DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { + typeof(global::Together.JsonConverters.DeEndpointVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlDTypeJsonConverter), typeof(global::Together.JsonConverters.RlDTypeNullableJsonConverter), @@ -21,10 +221,18 @@ namespace Together typeof(global::Together.JsonConverters.RlLossTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlWeightSyncTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlWeightSyncTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter), typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeJsonConverter), typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeNullableJsonConverter), @@ -33,14 +241,18 @@ namespace Together typeof(global::Together.JsonConverters.RlTrainingOperationStatusNullableJsonConverter), - typeof(global::Together.JsonConverters.RlSessionTypeJsonConverter), - - typeof(global::Together.JsonConverters.RlSessionTypeNullableJsonConverter), - typeof(global::Together.JsonConverters.RlTrainingSessionStatusJsonConverter), typeof(global::Together.JsonConverters.RlTrainingSessionStatusNullableJsonConverter), + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyNullableJsonConverter), + typeof(global::Together.JsonConverters.RlCheckpointVariantJsonConverter), typeof(global::Together.JsonConverters.RlCheckpointVariantNullableJsonConverter), @@ -85,6 +297,10 @@ namespace Together typeof(global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelNullableJsonConverter), + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter), + + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeNullableJsonConverter), + typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseJsonConverter), typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseNullableJsonConverter), @@ -97,6 +313,10 @@ namespace Together typeof(global::Together.JsonConverters.NodePhaseTransitionPhaseNullableJsonConverter), + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter), + + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter), + typeof(global::Together.JsonConverters.RemediationModeJsonConverter), typeof(global::Together.JsonConverters.RemediationModeNullableJsonConverter), @@ -301,6 +521,14 @@ namespace Together typeof(global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FileProcessingStatusJsonConverter), + + typeof(global::Together.JsonConverters.FileProcessingStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FilePurposeJsonConverter), typeof(global::Together.JsonConverters.FilePurposeNullableJsonConverter), @@ -317,6 +545,14 @@ namespace Together typeof(global::Together.JsonConverters.FinetuneResponseTrainOnInputsNullableJsonConverter), + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullableJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullableJsonConverter), + typeof(global::Together.JsonConverters.FinetuneJobStatusJsonConverter), typeof(global::Together.JsonConverters.FinetuneJobStatusNullableJsonConverter), @@ -329,6 +565,10 @@ namespace Together typeof(global::Together.JsonConverters.FinetuneEventTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter), + + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointNullableJsonConverter), + typeof(global::Together.JsonConverters.FullTrainingTypeTypeJsonConverter), typeof(global::Together.JsonConverters.FullTrainingTypeTypeNullableJsonConverter), @@ -549,6 +789,30 @@ namespace Together typeof(global::Together.JsonConverters.UpdateEndpointRequestStateNullableJsonConverter), + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter), + + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullableJsonConverter), + typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointJsonConverter), typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointNullableJsonConverter), @@ -569,18 +833,50 @@ namespace Together typeof(global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatNullableJsonConverter), + typeof(global::Together.JsonConverters.ListModelResourcesStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListModelResourcesStatuNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuNullableJsonConverter), + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemJsonConverter), typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemNullableJsonConverter), - typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeJsonConverter), + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter), - typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeNullableJsonConverter), + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter), typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusJsonConverter), typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusNullableJsonConverter), + typeof(global::Together.JsonConverters.DePlacementJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter), + + typeof(global::Together.JsonConverters.DeAutoscalingResponseJsonConverter), + typeof(global::Together.JsonConverters.CompletionStreamJsonConverter), typeof(global::Together.JsonConverters.ResponseFormatJsonConverter), @@ -691,6 +987,10 @@ namespace Together typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), typeof(global::Together.JsonConverters.AnyOfJsonConverter), @@ -719,6 +1019,10 @@ namespace Together typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), typeof(global::Together.JsonConverters.UnixTimestampJsonConverter), @@ -727,41 +1031,302 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JsonSerializerContextTypes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListPublicEndpointsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePublicEndpoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListEndpointsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTrafficSplitEntry))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointVisibility), TypeInfoPropertyName = "DeEndpointVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEndpointType), TypeInfoPropertyName = "DeEndpointEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryTrafficMode), TypeInfoPropertyName = "DeDeploymentSummaryTrafficMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryState), TypeInfoPropertyName = "DeDeploymentSummaryState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse), TypeInfoPropertyName = "DeAutoscalingResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequestVisibility), TypeInfoPropertyName = "DeCreateEndpointRequestVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdateVisibility), TypeInfoPropertyName = "DeEndpointUpdateVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscaling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacement), TypeInfoPropertyName = "DePlacement2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateABExperimentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateABExperimentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRemoteUploadSpec))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListFilesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListFilesResponseFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListEndpointAccessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAccessEntry))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListInferenceInstanceTypesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInferenceInstanceType))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRevokeEndpointAccessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRemoteUploadsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUpload))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListPlacementProfilesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementProfile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRemoteUploadEventsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRevokeEndpointAccessRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeGrantEndpointAccessRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeployment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentTrafficMode), TypeInfoPropertyName = "DeDeploymentTrafficMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRuntimeInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAdapterEntry))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatusState), TypeInfoPropertyName = "DeDeploymentAdapterStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListAdaptersResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAddAdapterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateAdapterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRolloutsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRollout))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRolloutRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCanaryConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeBlueGreenConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRollingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRule))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRolloutRequestSourceCleanup), TypeInfoPropertyName = "DeCreateRolloutRequestSourceCleanup2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStep))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleStat), TypeInfoPropertyName = "DeMetricRuleStat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheck))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheck))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheckOperator), TypeInfoPropertyName = "DeThresholdCheckOperator2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheckDirection), TypeInfoPropertyName = "DeRegressionCheckDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePauseRolloutRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeResumeRolloutRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequestDisposition), TypeInfoPropertyName = "DeCancelRolloutRequestDisposition2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePromoteRolloutRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePauseInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStrategy), TypeInfoPropertyName = "DeRolloutStrategy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutState), TypeInfoPropertyName = "DeRolloutState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutCondition))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionCategory), TypeInfoPropertyName = "DeRolloutConditionCategory2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatusState), TypeInfoPropertyName = "DeRolloutStepStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultStat), TypeInfoPropertyName = "DeMetricResultStat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultCheck), TypeInfoPropertyName = "DeMetricResultCheck2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultOperator), TypeInfoPropertyName = "DeMetricResultOperator2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultDirection), TypeInfoPropertyName = "DeMetricResultDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultVerdict), TypeInfoPropertyName = "DeMetricResultVerdict2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperiment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMemberRole), TypeInfoPropertyName = "DeABExperimentMemberRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacement))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacementConstraint), TypeInfoPropertyName = "DeInlinePlacementConstraint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListModelsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListSupportedModelsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelDeploymentProfile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelPerformanceBenchmarks))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelInputModalitie), TypeInfoPropertyName = "DeSupportedModelInputModalitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelOutputModalitie), TypeInfoPropertyName = "DeSupportedModelOutputModalitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelProduct), TypeInfoPropertyName = "DeSupportedModelProduct2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelFeature), TypeInfoPropertyName = "DeSupportedModelFeature2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelCapabilitie), TypeInfoPropertyName = "DeSupportedModelCapabilitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelStatus), TypeInfoPropertyName = "DeSupportedModelStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListEndpointEventsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevision))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListProjectConfigsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListDeploymentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListABExperimentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateShadowExperimentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateShadowExperimentTargetRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateShadowExperimentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateShadowExperimentTargetRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListShadowExperimentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperiment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListShadowExperimentTargetsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentTarget))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSourceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentState), TypeInfoPropertyName = "DeShadowExperimentState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentEndpointSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSampling), TypeInfoPropertyName = "DeShadowExperimentSampling2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentEndpointSourceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponse), TypeInfoPropertyName = "DeShadowExperimentSamplingResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentUniformSamplingResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentKeyBasedSamplingResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant3))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant4))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentUniformSampling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentKeyBasedSampling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant3))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveUniformSampling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant4))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSampling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequestVisibility), TypeInfoPropertyName = "DeUpdateModelRequestVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegion))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroom))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroomRelation), TypeInfoPropertyName = "DeHeadroomRelation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAnalyticsData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricsTimeRange))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTimeSeriesDataPoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAnalyticsData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadStatus), TypeInfoPropertyName = "DeRemoteUploadStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertification))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSelector))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeights))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelVisibility), TypeInfoPropertyName = "DeModelVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEventLevel), TypeInfoPropertyName = "DeRemoteUploadEventLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetric))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatusState), TypeInfoPropertyName = "DeDeploymentStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventLevel), TypeInfoPropertyName = "DeEndpointEventLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventSourceKind), TypeInfoPropertyName = "DeEndpointEventSourceKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus), TypeInfoPropertyName = "DeListRevisionsResponseRevisionValidationStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRevisionValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRequestMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeLatencyMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThroughputMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeErrorMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeResourceUtilization))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTokenMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfigEngineType), TypeInfoPropertyName = "DeConfigEngineType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfigDeploymentFramework), TypeInfoPropertyName = "DeConfigDeploymentFramework2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfigSelector))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationTarget), TypeInfoPropertyName = "DeCertificationTarget2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationCertificationType), TypeInfoPropertyName = "DeCertificationCertificationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelExternal))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelLicense))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsType), TypeInfoPropertyName = "DeModelWeightsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsSpeculatorMechanism), TypeInfoPropertyName = "DeModelWeightsSpeculatorMechanism2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsDraftSpeculatorType), TypeInfoPropertyName = "DeModelWeightsDraftSpeculatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelParameters))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType), TypeInfoPropertyName = "DeScalingMetricType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelDTypeCount))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightSyncType), TypeInfoPropertyName = "RlWeightSyncType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlAdamWOptimizerParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonOptimizerParams))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelInput))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSamplingParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSample))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInputChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringInt322")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlEncodedText))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlListMeta))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelFullModeConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelLoraModeConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus), TypeInfoPropertyName = "RlModelResourcesStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResources))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimizerConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode), TypeInfoPropertyName = "RlModelResourcesErrorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCreateModelResourcesRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesEstimateCostResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelTrainerConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelSamplingDefaults))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelGeneratorConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDType), TypeInfoPropertyName = "RlDType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossType), TypeInfoPropertyName = "RlLossType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCrossEntropyLossParams))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossParams))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossAggregationType), TypeInfoPropertyName = "RlGRPOLossAggregationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossRatioType), TypeInfoPropertyName = "RlGRPOLossRatioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPPOLossParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCispoLossParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDroLossParams))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossTargetTokens))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossMask))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossAdvantages))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossLogprobs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossInputs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlImportanceSamplingLossInputs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPPOLossInputs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCispoLossInputs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDroLossInputs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossInputs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPolicyVersionSegment))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepOperation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationStatus), TypeInfoPropertyName = "RlTrainingOperationStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepResult))] @@ -772,24 +1337,36 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleRollout))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleSequence))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardOperation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTargetLogprobGradients))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardOperation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardOperation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTargetLogprobs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationErrorCode), TypeInfoPropertyName = "RlTrainingOperationErrorCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlStartTrainingSessionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSessionType), TypeInfoPropertyName = "RlSessionType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLoraConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionStatus), TypeInfoPropertyName = "RlTrainingSessionStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionErrorCode), TypeInfoPropertyName = "RlTrainingSessionErrorCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSession))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpoint))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingCheckpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionsListResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelsListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlAdamWOptimizerConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonOptimizerConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonScalingStrategy), TypeInfoPropertyName = "RlMuonScalingStrategy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointOperation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointResult))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointRegistration))] @@ -798,6 +1375,7 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant), TypeInfoPropertyName = "RlCheckpointVariant2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointFile))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringInt642")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointDownloadResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorResponse))] @@ -829,6 +1407,8 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoBillingType), TypeInfoPropertyName = "GPUClusterInfoBillingType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterNodeLifecycleEvent))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequestClusterType), TypeInfoPropertyName = "GPUClusterUpdateRequestClusterType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -847,10 +1427,18 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnState))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardState))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressState))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassState))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebState))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampState))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CommentBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequestMode), TypeInfoPropertyName = "ApproveRemediationRequestMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnCreateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnDeleteResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnUpdateRequest))] @@ -864,6 +1452,10 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListRemediationsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.NodePhaseTransitionPhase), TypeInfoPropertyName = "NodePhaseTransitionPhase2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListPassiveHealthCheckAlertsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlert))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity), TypeInfoPropertyName = "PassiveHealthCheckAlertSeverity2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode), TypeInfoPropertyName = "RemediationMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger), TypeInfoPropertyName = "RemediationTrigger2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState), TypeInfoPropertyName = "RemediationState2")] @@ -884,7 +1476,6 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequestModel), TypeInfoPropertyName = "RerankRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf, global::System.Collections.Generic.IList>), TypeInfoPropertyName = "OneOfIListObjectIListString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankResponseResult))] @@ -904,7 +1495,6 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestModel), TypeInfoPropertyName = "CompletionRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCompletionRequestSafetyModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestSafetyModel), TypeInfoPropertyName = "CompletionRequestSafetyModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionStream), TypeInfoPropertyName = "CompletionStream2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionEvent))] @@ -937,85 +1527,1114 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum), TypeInfoPropertyName = "ChatCompletionRequestFunctionCallEnum2_3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormat), TypeInfoPropertyName = "ResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatText))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType), TypeInfoPropertyName = "ChatCompletionRequestResponseFormatDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolsPart))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringToolChoice22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoningEffort), TypeInfoPropertyName = "ChatCompletionRequestReasoningEffort2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoning))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatTextType), TypeInfoPropertyName = "ResponseFormatTextType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObjectType), TypeInfoPropertyName = "ResponseFormatJsonObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaType), TypeInfoPropertyName = "ResponseFormatJsonSchemaType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaJsonSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole), TypeInfoPropertyName = "ChatCompletionSystemMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent), TypeInfoPropertyName = "ChatCompletionUserMessageContent2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole), TypeInfoPropertyName = "ChatCompletionUserMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant1Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant2Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVideoType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole), TypeInfoPropertyName = "ChatCompletionAssistantMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamFunctionCall))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParamRole), TypeInfoPropertyName = "ChatCompletionFunctionMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole), TypeInfoPropertyName = "ChatCompletionToolMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream), TypeInfoPropertyName = "ChatCompletionStream2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDelta))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole), TypeInfoPropertyName = "ChatCompletionChunkChoiceDeltaRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaFunctionCall))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfAudioSpeechRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel), TypeInfoPropertyName = "AudioSpeechRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseFormat), TypeInfoPropertyName = "AudioSpeechRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseEncoding), TypeInfoPropertyName = "AudioSpeechRequestResponseEncoding2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestExtraParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfByteArrayString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestModel), TypeInfoPropertyName = "AudioTranscriptionRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestResponseFormat), TypeInfoPropertyName = "AudioTranscriptionRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfAudioTranscriptionRequestTimestampGranularitiesIListAudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularities), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularities2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionResponse), TypeInfoPropertyName = "AudioTranscriptionResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionVerboseJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionWord))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSpeakerSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestModel), TypeInfoPropertyName = "AudioTranslationRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestResponseFormat), TypeInfoPropertyName = "AudioTranslationRequestResponseFormat2")] + internal sealed partial class SourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + typeof(global::Together.JsonConverters.DeEndpointVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlDTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlDTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlLossTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlLossTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlWeightSyncTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlWeightSyncTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingOperationStatusJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingOperationStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionStatusJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlCheckpointVariantJsonConverter), + + typeof(global::Together.JsonConverters.RlCheckpointVariantNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestClusterTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestClusterTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestGpuTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestGpuTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestBillingTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterCreateRequestBillingTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoClusterTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoClusterTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoGpuTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoGpuTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoStatusJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoBillingTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterInfoBillingTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterUpdateRequestClusterTypeJsonConverter), + + typeof(global::Together.JsonConverters.GPUClusterUpdateRequestClusterTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.InstanceTypesResponseTypeJsonConverter), + + typeof(global::Together.JsonConverters.InstanceTypesResponseTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelJsonConverter), + + typeof(global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter), + + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseJsonConverter), + + typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseNullableJsonConverter), + + typeof(global::Together.JsonConverters.InstanceClusterConfigLoadBalancerJsonConverter), + + typeof(global::Together.JsonConverters.InstanceClusterConfigLoadBalancerNullableJsonConverter), + + typeof(global::Together.JsonConverters.NodePhaseTransitionPhaseJsonConverter), + + typeof(global::Together.JsonConverters.NodePhaseTransitionPhaseNullableJsonConverter), + + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter), + + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationModeJsonConverter), + + typeof(global::Together.JsonConverters.RemediationModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationTriggerJsonConverter), + + typeof(global::Together.JsonConverters.RemediationTriggerNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationStateJsonConverter), + + typeof(global::Together.JsonConverters.RemediationStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.GPUClustersSharedVolumeStatusJsonConverter), + + typeof(global::Together.JsonConverters.GPUClustersSharedVolumeStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RerankRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.RerankRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinishReasonJsonConverter), + + typeof(global::Together.JsonConverters.FinishReasonNullableJsonConverter), + + typeof(global::Together.JsonConverters.CompletionRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.CompletionRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.CompletionRequestSafetyModelJsonConverter), + + typeof(global::Together.JsonConverters.CompletionRequestSafetyModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.CompletionChoiceDeltaRoleJsonConverter), + + typeof(global::Together.JsonConverters.CompletionChoiceDeltaRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionMessageRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionMessageRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionToolTypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionToolTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestContextLengthExceededBehaviorJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestContextLengthExceededBehaviorNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestFunctionCallEnumJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestFunctionCallEnumNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestResponseFormatDiscriminatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestResponseFormatDiscriminatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestReasoningEffortJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionRequestReasoningEffortNullableJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatTextTypeJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatTextTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatJsonObjectTypeJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatJsonObjectTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatJsonSchemaTypeJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatJsonSchemaTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionSystemMessageParamRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionSystemMessageParamRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageParamRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageParamRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant1TypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant1TypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant2TypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant2TypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVideoTypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVideoTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemAudioTypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemAudioTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioTypeJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormatJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionAssistantMessageParamRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionAssistantMessageParamRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionFunctionMessageParamRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionFunctionMessageParamRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionToolMessageParamRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionToolMessageParamRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionChunkChoiceDeltaRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionChunkChoiceDeltaRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestResponseFormatJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestResponseFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestResponseEncodingJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechRequestResponseEncodingNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestResponseFormatJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestResponseFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitiesJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitiesNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitieJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestResponseFormatJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestResponseFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitiesJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitiesNullableJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitieJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.StreamSentinelDataJsonConverter), + + typeof(global::Together.JsonConverters.StreamSentinelDataNullableJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionChoiceDeltaRoleJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionChoiceDeltaRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.EmbeddingsRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.EmbeddingsRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.ModelInfoTypeJsonConverter), + + typeof(global::Together.JsonConverters.ModelInfoTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ModelUploadRequestModelTypeJsonConverter), + + typeof(global::Together.JsonConverters.ModelUploadRequestModelTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataItemDiscriminatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataItemDiscriminatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataB64TypeJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataB64TypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataUrlTypeJsonConverter), + + typeof(global::Together.JsonConverters.ImageResponseDataUrlTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.JobInfoSuccessResponseStatusJsonConverter), + + typeof(global::Together.JsonConverters.JobInfoSuccessResponseStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.ToolChoiceTypeJsonConverter), + + typeof(global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FileProcessingStatusJsonConverter), + + typeof(global::Together.JsonConverters.FileProcessingStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FilePurposeJsonConverter), + + typeof(global::Together.JsonConverters.FilePurposeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FileTypeJsonConverter), + + typeof(global::Together.JsonConverters.FileTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneResponseBatchSizeJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneResponseBatchSizeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneResponseTrainOnInputsJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneResponseTrainOnInputsNullableJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullableJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneJobStatusJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneJobStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneEventLevelsJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneEventLevelsNullableJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneEventTypeJsonConverter), + + typeof(global::Together.JsonConverters.FinetuneEventTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter), + + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointNullableJsonConverter), + + typeof(global::Together.JsonConverters.FullTrainingTypeTypeJsonConverter), + + typeof(global::Together.JsonConverters.FullTrainingTypeTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.LoRATrainingTypeTypeJsonConverter), + + typeof(global::Together.JsonConverters.LoRATrainingTypeTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodSFTMethodJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodSFTMethodNullableJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodSFTTrainOnInputsJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodSFTTrainOnInputsNullableJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodDPOMethodJsonConverter), + + typeof(global::Together.JsonConverters.TrainingMethodDPOMethodNullableJsonConverter), + + typeof(global::Together.JsonConverters.LRSchedulerLrSchedulerTypeJsonConverter), + + typeof(global::Together.JsonConverters.LRSchedulerLrSchedulerTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.HardwareAvailabilityStatusJsonConverter), + + typeof(global::Together.JsonConverters.HardwareAvailabilityStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateEndpointRequestStateJsonConverter), + + typeof(global::Together.JsonConverters.CreateEndpointRequestStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DedicatedEndpointTypeJsonConverter), + + typeof(global::Together.JsonConverters.DedicatedEndpointTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DedicatedEndpointStateJsonConverter), + + typeof(global::Together.JsonConverters.DedicatedEndpointStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointTypeJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointStateJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DisplayorExecuteOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.DisplayorExecuteOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ErrorOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.ErrorOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteRequestFileEncodingJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteRequestFileEncodingNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteRequestLanguageJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteRequestLanguageNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputStreamOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputStreamOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputErrorOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputErrorOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputDiscriminatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputDiscriminatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.StreamOutputTypeJsonConverter), + + typeof(global::Together.JsonConverters.StreamOutputTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateBatchRequestEndpointJsonConverter), + + typeof(global::Together.JsonConverters.CreateBatchRequestEndpointNullableJsonConverter), + + typeof(global::Together.JsonConverters.BatchJobStatusJsonConverter), + + typeof(global::Together.JsonConverters.BatchJobStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationTypedRequestTypeJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationTypedRequestTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJudgeModelConfigModelSourceJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJudgeModelConfigModelSourceNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationModelRequestModelSourceJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationModelRequestModelSourceNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationResponseStatusJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationResponseStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJobTypeJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJobTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJobStatusJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationJobStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.VideoStatusJsonConverter), + + typeof(global::Together.JsonConverters.VideoStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.VideoFrameImageInputFrameJsonConverter), + + typeof(global::Together.JsonConverters.VideoFrameImageInputFrameNullableJsonConverter), + + typeof(global::Together.JsonConverters.VideoOutputFormatJsonConverter), + + typeof(global::Together.JsonConverters.VideoOutputFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateDeploymentRequestGpuTypeJsonConverter), + + typeof(global::Together.JsonConverters.CreateDeploymentRequestGpuTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeploymentResponseItemGpuTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeploymentResponseItemGpuTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeploymentStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeploymentStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.HTTPAutoscalingConfigMetricJsonConverter), + + typeof(global::Together.JsonConverters.HTTPAutoscalingConfigMetricNullableJsonConverter), + + typeof(global::Together.JsonConverters.QueueAutoscalingConfigMetricJsonConverter), + + typeof(global::Together.JsonConverters.QueueAutoscalingConfigMetricNullableJsonConverter), + + typeof(global::Together.JsonConverters.CustomMetricAutoscalingConfigMetricJsonConverter), + + typeof(global::Together.JsonConverters.CustomMetricAutoscalingConfigMetricNullableJsonConverter), + + typeof(global::Together.JsonConverters.UpdateDeploymentRequestGpuTypeJsonConverter), + + typeof(global::Together.JsonConverters.UpdateDeploymentRequestGpuTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeContentRequestTypeJsonConverter), + + typeof(global::Together.JsonConverters.VolumeContentRequestTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeContentTypeJsonConverter), + + typeof(global::Together.JsonConverters.VolumeContentTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeTypeJsonConverter), + + typeof(global::Together.JsonConverters.VolumeTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.QueueCancelResponseStatusJsonConverter), + + typeof(global::Together.JsonConverters.QueueCancelResponseStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.QueueJobStatusResponseStatusJsonConverter), + + typeof(global::Together.JsonConverters.QueueJobStatusResponseStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestModelJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestResponseFormatJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestResponseFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestOutputFormatJsonConverter), + + typeof(global::Together.JsonConverters.CreateImagesGenerationsRequestOutputFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesRequestBatchSizeJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesRequestBatchSizeNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesRequestTrainOnInputsJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullableJsonConverter), + + typeof(global::Together.JsonConverters.UpdateEndpointRequestStateJsonConverter), + + typeof(global::Together.JsonConverters.UpdateEndpointRequestStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter), + + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullableJsonConverter), + + typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointJsonConverter), + + typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointNullableJsonConverter), + + typeof(global::Together.JsonConverters.RealtimeTtsModelJsonConverter), + + typeof(global::Together.JsonConverters.RealtimeTtsModelNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointsTypeJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointsTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointsUsageTypeJsonConverter), + + typeof(global::Together.JsonConverters.ListEndpointsUsageTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatJsonConverter), + + typeof(global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListModelResourcesStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListModelResourcesStatuNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter), + + typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusJsonConverter), + + typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DePlacementJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter), + + typeof(global::Together.JsonConverters.DeAutoscalingResponseJsonConverter), + + typeof(global::Together.JsonConverters.CompletionStreamJsonConverter), + + typeof(global::Together.JsonConverters.ResponseFormatJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionMessageParamJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionUserMessageContentJsonConverter), + + typeof(global::Together.JsonConverters.ChatCompletionStreamJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranscriptionResponseJsonConverter), + + typeof(global::Together.JsonConverters.AudioTranslationResponseJsonConverter), + + typeof(global::Together.JsonConverters.AudioSpeechStreamResponseJsonConverter), + + typeof(global::Together.JsonConverters.DataItem3JsonConverter), + + typeof(global::Together.JsonConverters.ErrorJsonConverter), + + typeof(global::Together.JsonConverters.ExecuteResponseJsonConverter), + + typeof(global::Together.JsonConverters.OutputsItemJsonConverter), + + typeof(global::Together.JsonConverters.InterpreterOutputJsonConverter), + + typeof(global::Together.JsonConverters.SessionListResponseJsonConverter), + + typeof(global::Together.JsonConverters.EvaluationModelOrStringJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.AllOfJsonConverter), + + typeof(global::Together.JsonConverters.AllOfJsonConverter), + + typeof(global::Together.JsonConverters.AllOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.AllOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter>), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter>), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter>), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.AnyOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.UnixTimestampJsonConverter), + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_9a6c1a339fc4e5a1")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatText))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType), TypeInfoPropertyName = "ChatCompletionRequestResponseFormatDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolsPart))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringToolChoice22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoningEffort), TypeInfoPropertyName = "ChatCompletionRequestReasoningEffort2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoning))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatTextType), TypeInfoPropertyName = "ResponseFormatTextType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObjectType), TypeInfoPropertyName = "ResponseFormatJsonObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaType), TypeInfoPropertyName = "ResponseFormatJsonSchemaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaJsonSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole), TypeInfoPropertyName = "ChatCompletionSystemMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent), TypeInfoPropertyName = "ChatCompletionUserMessageContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole), TypeInfoPropertyName = "ChatCompletionUserMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant1Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant2Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVideoType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemAudioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole), TypeInfoPropertyName = "ChatCompletionAssistantMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamFunctionCall))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParamRole), TypeInfoPropertyName = "ChatCompletionFunctionMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole), TypeInfoPropertyName = "ChatCompletionToolMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream), TypeInfoPropertyName = "ChatCompletionStream2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunk))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoice))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDelta))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole), TypeInfoPropertyName = "ChatCompletionChunkChoiceDeltaRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaFunctionCall))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfAudioSpeechRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel), TypeInfoPropertyName = "AudioSpeechRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseFormat), TypeInfoPropertyName = "AudioSpeechRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseEncoding), TypeInfoPropertyName = "AudioSpeechRequestResponseEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestExtraParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfByteArrayString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestModel), TypeInfoPropertyName = "AudioTranscriptionRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestResponseFormat), TypeInfoPropertyName = "AudioTranscriptionRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfAudioTranscriptionRequestTimestampGranularitiesIListAudioTranscriptionRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularities), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularities2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionResponse), TypeInfoPropertyName = "AudioTranscriptionResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionJsonResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionVerboseJsonResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSegment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionWord))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSpeakerSegment))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestModel), TypeInfoPropertyName = "AudioTranslationRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestResponseFormat), TypeInfoPropertyName = "AudioTranslationRequestResponseFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfAudioTranslationRequestTimestampGranularitiesIListAudioTranslationRequestTimestampGranularitie2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularities), TypeInfoPropertyName = "AudioTranslationRequestTimestampGranularities2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -1069,6 +2688,9 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FilePurpose), TypeInfoPropertyName = "FilePurpose2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileType), TypeInfoPropertyName = "FileType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileProcessingStatus), TypeInfoPropertyName = "FileProcessingStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReport))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReportErrorType), TypeInfoPropertyName = "FileValidationReportErrorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileDeleteResponse))] @@ -1092,6 +2714,16 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneProgress))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseTruncated))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequestTrainingMethod), TypeInfoPropertyName = "FineTunePreviewRequestTrainingMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponseDatasetFormat), TypeInfoPropertyName = "FineTunePreviewResponseDatasetFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRow))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewMessageError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewDetailError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimits))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimitsFullTraining))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimitsLoraTraining))] @@ -1103,6 +2735,7 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneListCheckpoints))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpointCheckpoint), TypeInfoPropertyName = "FineTuneCheckpointCheckpoint2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FullTrainingTypeType), TypeInfoPropertyName = "FullTrainingTypeType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LoRATrainingTypeType), TypeInfoPropertyName = "LoRATrainingTypeType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTMethod), TypeInfoPropertyName = "TrainingMethodSFTMethod2")] @@ -1189,8 +2822,9 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationCompareParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelOrString), TypeInfoPropertyName = "EvaluationModelOrString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfigModelSource), TypeInfoPropertyName = "EvaluationJudgeModelConfigModelSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationModelRequestString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfigModelSource), TypeInfoPropertyName = "EvaluationJudgeModelConfigModelSource2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequestModelSource), TypeInfoPropertyName = "EvaluationModelRequestModelSource2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponseStatus), TypeInfoPropertyName = "EvaluationResponseStatus2")] @@ -1223,7 +2857,202 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoJobError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoJobOutputs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ContainerStatus))] - internal sealed partial class SourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SignedURLResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfHTTPAutoscalingConfigQueueAutoscalingConfigCustomMetricAutoscalingConfig2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EnvironmentVariable))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestGpuType), TypeInfoPropertyName = "CreateDeploymentRequestGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeMount))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateSecretRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateVolumeRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType), TypeInfoPropertyName = "VolumeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentLogs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemGpuType), TypeInfoPropertyName = "DeploymentResponseItemGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ReplicaEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentStatus), TypeInfoPropertyName = "DeploymentStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfigMetric), TypeInfoPropertyName = "HTTPAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfigMetric), TypeInfoPropertyName = "QueueAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfigMetric), TypeInfoPropertyName = "CustomMetricAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.KubernetesEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListSecretsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SecretResponseItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListVolumesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeResponseItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestGpuType), TypeInfoPropertyName = "UpdateDeploymentRequestGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateSecretRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateVolumeRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VersionHistoryItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType), TypeInfoPropertyName = "VolumeContentRequestType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType), TypeInfoPropertyName = "VolumeContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueMetricsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus), TypeInfoPropertyName = "QueueCancelResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueClearRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueClearResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus), TypeInfoPropertyName = "QueueJobStatusResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCreateImagesGenerationsRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel), TypeInfoPropertyName = "CreateImagesGenerationsRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestImageLora))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFilesUploadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfInt32CreateFineTunesRequestBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize), TypeInfoPropertyName = "CreateFineTunesRequestBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfBooleanCreateFineTunesRequestTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestTrainOnInputs), TypeInfoPropertyName = "CreateFineTunesRequestTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfFullTrainingTypeLoRATrainingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequestState), TypeInfoPropertyName = "UpdateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddAdapterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemoveAdapterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter), TypeInfoPropertyName = "RolloutServiceListRolloutsFilter2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel), TypeInfoPropertyName = "EndpointServiceListEndpointEventsMinLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsSourceKind), TypeInfoPropertyName = "EndpointServiceListEndpointEventsSourceKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeServiceListModelsVisibility), TypeInfoPropertyName = "VolumeServiceListModelsVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsModality), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsModality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsProduct2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint), TypeInfoPropertyName = "GetFinetuneDownloadCheckpoint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel), TypeInfoPropertyName = "RealtimeTtsModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsType), TypeInfoPropertyName = "ListEndpointsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsUsageType), TypeInfoPropertyName = "ListEndpointsUsageType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat), TypeInfoPropertyName = "RealtimeTranscriptionInputAudioFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu), TypeInfoPropertyName = "ListModelResourcesStatu2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListTrainingSessionsStatu), TypeInfoPropertyName = "ListTrainingSessionsStatu2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsStateItem), TypeInfoPropertyName = "RemediationServiceListRemediationsStateItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsTriggerItem), TypeInfoPropertyName = "RemediationServiceListRemediationsTriggerItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsModeItem), TypeInfoPropertyName = "RemediationServiceListRemediationsModeItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus), TypeInfoPropertyName = "HealthCheckServiceListPassiveHealthCheckAlertsStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem), TypeInfoPropertyName = "HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfCreateFineTunesEstimatePriceResponseVariant1CreateFineTunesEstimatePriceResponseVariant22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason), TypeInfoPropertyName = "CreateFineTunesEstimatePriceResponseVariant2UnavailableReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfFineTunePreviewMessageErrorFineTunePreviewDetailError2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesMetricsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponseDetailedModel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsLimitsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddAdapterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListAdaptersResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListAdaptersResponseDataItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemoveAdapterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListHardwareResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetModelListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus), TypeInfoPropertyName = "GetEvaluationJobStatusAndResultsResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResults2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointVisibility?), TypeInfoPropertyName = "NullableDeEndpointVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEndpointType?), TypeInfoPropertyName = "NullableDeEndpointEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryTrafficMode?), TypeInfoPropertyName = "NullableDeDeploymentSummaryTrafficMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryState?), TypeInfoPropertyName = "NullableDeDeploymentSummaryState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse?), TypeInfoPropertyName = "NullableDeAutoscalingResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequestVisibility?), TypeInfoPropertyName = "NullableDeCreateEndpointRequestVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdateVisibility?), TypeInfoPropertyName = "NullableDeEndpointUpdateVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacement?), TypeInfoPropertyName = "NullableDePlacement2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentTrafficMode?), TypeInfoPropertyName = "NullableDeDeploymentTrafficMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatusState?), TypeInfoPropertyName = "NullableDeDeploymentAdapterStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRolloutRequestSourceCleanup?), TypeInfoPropertyName = "NullableDeCreateRolloutRequestSourceCleanup2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleStat?), TypeInfoPropertyName = "NullableDeMetricRuleStat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheckOperator?), TypeInfoPropertyName = "NullableDeThresholdCheckOperator2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheckDirection?), TypeInfoPropertyName = "NullableDeRegressionCheckDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequestDisposition?), TypeInfoPropertyName = "NullableDeCancelRolloutRequestDisposition2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStrategy?), TypeInfoPropertyName = "NullableDeRolloutStrategy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutState?), TypeInfoPropertyName = "NullableDeRolloutState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionCategory?), TypeInfoPropertyName = "NullableDeRolloutConditionCategory2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatusState?), TypeInfoPropertyName = "NullableDeRolloutStepStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultStat?), TypeInfoPropertyName = "NullableDeMetricResultStat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultCheck?), TypeInfoPropertyName = "NullableDeMetricResultCheck2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultOperator?), TypeInfoPropertyName = "NullableDeMetricResultOperator2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultDirection?), TypeInfoPropertyName = "NullableDeMetricResultDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultVerdict?), TypeInfoPropertyName = "NullableDeMetricResultVerdict2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMemberRole?), TypeInfoPropertyName = "NullableDeABExperimentMemberRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacementConstraint?), TypeInfoPropertyName = "NullableDeInlinePlacementConstraint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelInputModalitie?), TypeInfoPropertyName = "NullableDeSupportedModelInputModalitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelOutputModalitie?), TypeInfoPropertyName = "NullableDeSupportedModelOutputModalitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelProduct?), TypeInfoPropertyName = "NullableDeSupportedModelProduct2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelFeature?), TypeInfoPropertyName = "NullableDeSupportedModelFeature2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelCapabilitie?), TypeInfoPropertyName = "NullableDeSupportedModelCapabilitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelStatus?), TypeInfoPropertyName = "NullableDeSupportedModelStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentState?), TypeInfoPropertyName = "NullableDeShadowExperimentState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSampling?), TypeInfoPropertyName = "NullableDeShadowExperimentSampling2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponse?), TypeInfoPropertyName = "NullableDeShadowExperimentSamplingResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequestVisibility?), TypeInfoPropertyName = "NullableDeUpdateModelRequestVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroomRelation?), TypeInfoPropertyName = "NullableDeHeadroomRelation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadStatus?), TypeInfoPropertyName = "NullableDeRemoteUploadStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelVisibility?), TypeInfoPropertyName = "NullableDeModelVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEventLevel?), TypeInfoPropertyName = "NullableDeRemoteUploadEventLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatusState?), TypeInfoPropertyName = "NullableDeDeploymentStatusState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventLevel?), TypeInfoPropertyName = "NullableDeEndpointEventLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventSourceKind?), TypeInfoPropertyName = "NullableDeEndpointEventSourceKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus?), TypeInfoPropertyName = "NullableDeListRevisionsResponseRevisionValidationStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfigEngineType?), TypeInfoPropertyName = "NullableDeConfigEngineType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeConfigDeploymentFramework?), TypeInfoPropertyName = "NullableDeConfigDeploymentFramework2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationTarget?), TypeInfoPropertyName = "NullableDeCertificationTarget2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationCertificationType?), TypeInfoPropertyName = "NullableDeCertificationCertificationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsType?), TypeInfoPropertyName = "NullableDeModelWeightsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsSpeculatorMechanism?), TypeInfoPropertyName = "NullableDeModelWeightsSpeculatorMechanism2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsDraftSpeculatorType?), TypeInfoPropertyName = "NullableDeModelWeightsDraftSpeculatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType?), TypeInfoPropertyName = "NullableDeScalingMetricType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightSyncType?), TypeInfoPropertyName = "NullableRlWeightSyncType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus?), TypeInfoPropertyName = "NullableRlModelResourcesStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode?), TypeInfoPropertyName = "NullableRlModelResourcesErrorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDType?), TypeInfoPropertyName = "NullableRlDType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossType?), TypeInfoPropertyName = "NullableRlLossType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossAggregationType?), TypeInfoPropertyName = "NullableRlGRPOLossAggregationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossRatioType?), TypeInfoPropertyName = "NullableRlGRPOLossRatioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationStatus?), TypeInfoPropertyName = "NullableRlTrainingOperationStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationErrorCode?), TypeInfoPropertyName = "NullableRlTrainingOperationErrorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionStatus?), TypeInfoPropertyName = "NullableRlTrainingSessionStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionErrorCode?), TypeInfoPropertyName = "NullableRlTrainingSessionErrorCode2")] + internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -1234,6 +3063,206 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { + typeof(global::Together.JsonConverters.DeEndpointVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEndpointTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentSummaryStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentTrafficModeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupJsonConverter), + + typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricRuleStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeThresholdCheckOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeRegressionCheckDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter), + + typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStrategyNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutConditionCategoryNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeRolloutStepStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultStatNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultCheckNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultOperatorNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultDirectionNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictJsonConverter), + + typeof(global::Together.JsonConverters.DeMetricResultVerdictNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter), + + typeof(global::Together.JsonConverters.DeABExperimentMemberRoleNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter), + + typeof(global::Together.JsonConverters.DeInlinePlacementConstraintNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelInputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelOutputModalitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelProductNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelFeatureNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelCapabilitieNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeSupportedModelStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationJsonConverter), + + typeof(global::Together.JsonConverters.DeHeadroomRelationNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.DeModelVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter), + + typeof(global::Together.JsonConverters.DeDeploymentStatusStateNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.DeEndpointEventSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter), + + typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigEngineTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkJsonConverter), + + typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationTargetNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeCertificationCertificationTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeJsonConverter), + + typeof(global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlDTypeJsonConverter), typeof(global::Together.JsonConverters.RlDTypeNullableJsonConverter), @@ -1242,10 +3271,18 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.RlLossTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlWeightSyncTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlWeightSyncTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter), typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter), + + typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeJsonConverter), typeof(global::Together.JsonConverters.RlTrainingOperationErrorCodeNullableJsonConverter), @@ -1254,14 +3291,18 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.RlTrainingOperationStatusNullableJsonConverter), - typeof(global::Together.JsonConverters.RlSessionTypeJsonConverter), - - typeof(global::Together.JsonConverters.RlSessionTypeNullableJsonConverter), - typeof(global::Together.JsonConverters.RlTrainingSessionStatusJsonConverter), typeof(global::Together.JsonConverters.RlTrainingSessionStatusNullableJsonConverter), + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter), + + typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeNullableJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter), + + typeof(global::Together.JsonConverters.RlMuonScalingStrategyNullableJsonConverter), + typeof(global::Together.JsonConverters.RlCheckpointVariantJsonConverter), typeof(global::Together.JsonConverters.RlCheckpointVariantNullableJsonConverter), @@ -1306,6 +3347,10 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelNullableJsonConverter), + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter), + + typeof(global::Together.JsonConverters.ApproveRemediationRequestModeNullableJsonConverter), + typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseJsonConverter), typeof(global::Together.JsonConverters.ClusterPhaseTransitionPhaseNullableJsonConverter), @@ -1318,6 +3363,10 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.NodePhaseTransitionPhaseNullableJsonConverter), + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter), + + typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter), + typeof(global::Together.JsonConverters.RemediationModeJsonConverter), typeof(global::Together.JsonConverters.RemediationModeNullableJsonConverter), @@ -1522,6 +3571,14 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FileProcessingStatusJsonConverter), + + typeof(global::Together.JsonConverters.FileProcessingStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter), + + typeof(global::Together.JsonConverters.FileValidationReportErrorTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FilePurposeJsonConverter), typeof(global::Together.JsonConverters.FilePurposeNullableJsonConverter), @@ -1538,6 +3595,14 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.FinetuneResponseTrainOnInputsNullableJsonConverter), + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullableJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter), + + typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullableJsonConverter), + typeof(global::Together.JsonConverters.FinetuneJobStatusJsonConverter), typeof(global::Together.JsonConverters.FinetuneJobStatusNullableJsonConverter), @@ -1550,6 +3615,10 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.FinetuneEventTypeNullableJsonConverter), + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter), + + typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointNullableJsonConverter), + typeof(global::Together.JsonConverters.FullTrainingTypeTypeJsonConverter), typeof(global::Together.JsonConverters.FullTrainingTypeTypeNullableJsonConverter), @@ -1770,6 +3839,30 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.UpdateEndpointRequestStateNullableJsonConverter), + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter), + + typeof(global::Together.JsonConverters.RolloutServiceListRolloutsFilterNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullableJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindJsonConverter), + + typeof(global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullableJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityJsonConverter), + + typeof(global::Together.JsonConverters.VolumeServiceListModelsVisibilityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductJsonConverter), + + typeof(global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullableJsonConverter), + typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointJsonConverter), typeof(global::Together.JsonConverters.GetFinetuneDownloadCheckpointNullableJsonConverter), @@ -1790,18 +3883,50 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatNullableJsonConverter), + typeof(global::Together.JsonConverters.ListModelResourcesStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListModelResourcesStatuNullableJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuJsonConverter), + + typeof(global::Together.JsonConverters.ListTrainingSessionsStatuNullableJsonConverter), + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemJsonConverter), typeof(global::Together.JsonConverters.RemediationServiceListRemediationsStateItemNullableJsonConverter), - typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeJsonConverter), + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemJsonConverter), - typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeNullableJsonConverter), + typeof(global::Together.JsonConverters.RemediationServiceListRemediationsModeItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter), + + typeof(global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter), + + typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter), typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusJsonConverter), typeof(global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusNullableJsonConverter), + typeof(global::Together.JsonConverters.DePlacementJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter), + + typeof(global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter), + + typeof(global::Together.JsonConverters.DeAutoscalingResponseJsonConverter), + typeof(global::Together.JsonConverters.CompletionStreamJsonConverter), typeof(global::Together.JsonConverters.ResponseFormatJsonConverter), @@ -1912,6 +4037,10 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), typeof(global::Together.JsonConverters.AnyOfJsonConverter), @@ -1940,6 +4069,10 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), + + typeof(global::Together.JsonConverters.OneOfJsonConverter), + typeof(global::Together.JsonConverters.OneOfJsonConverter), typeof(global::Together.JsonConverters.UnixTimestampJsonConverter), @@ -1948,112 +4081,275 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SignedURLResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfHTTPAutoscalingConfigQueueAutoscalingConfigCustomMetricAutoscalingConfig2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EnvironmentVariable))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestGpuType), TypeInfoPropertyName = "CreateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeMount))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateSecretRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateVolumeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType), TypeInfoPropertyName = "VolumeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentLogs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemGpuType), TypeInfoPropertyName = "DeploymentResponseItemGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ReplicaEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentStatus), TypeInfoPropertyName = "DeploymentStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfigMetric), TypeInfoPropertyName = "HTTPAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfigMetric), TypeInfoPropertyName = "QueueAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfigMetric), TypeInfoPropertyName = "CustomMetricAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.KubernetesEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListSecretsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SecretResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListVolumesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestGpuType), TypeInfoPropertyName = "UpdateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateSecretRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateVolumeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VersionHistoryItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType), TypeInfoPropertyName = "VolumeContentRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType), TypeInfoPropertyName = "VolumeContentType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueMetricsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus), TypeInfoPropertyName = "QueueCancelResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus), TypeInfoPropertyName = "QueueJobStatusResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCreateImagesGenerationsRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel), TypeInfoPropertyName = "CreateImagesGenerationsRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestOutputFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestImageLora))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFilesUploadRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfInt32CreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize), TypeInfoPropertyName = "CreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfBooleanCreateFineTunesRequestTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestTrainOnInputs), TypeInfoPropertyName = "CreateFineTunesRequestTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfFullTrainingTypeLoRATrainingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequestState), TypeInfoPropertyName = "UpdateEndpointRequestState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint), TypeInfoPropertyName = "GetFinetuneDownloadCheckpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel), TypeInfoPropertyName = "RealtimeTtsModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsType), TypeInfoPropertyName = "ListEndpointsType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsUsageType), TypeInfoPropertyName = "ListEndpointsUsageType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat), TypeInfoPropertyName = "RealtimeTranscriptionInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsStateItem), TypeInfoPropertyName = "RemediationServiceListRemediationsStateItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsMode), TypeInfoPropertyName = "RemediationServiceListRemediationsMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesMetricsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsLimitsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListHardwareResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetModelListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus), TypeInfoPropertyName = "GetEvaluationJobStatusAndResultsResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResults2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonScalingStrategy?), TypeInfoPropertyName = "NullableRlMuonScalingStrategy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant?), TypeInfoPropertyName = "NullableRlCheckpointVariant2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringInt642")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestClusterType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestClusterType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestGpuType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestBillingType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestBillingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoClusterType?), TypeInfoPropertyName = "NullableGPUClusterInfoClusterType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoGpuType?), TypeInfoPropertyName = "NullableGPUClusterInfoGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoStatus?), TypeInfoPropertyName = "NullableGPUClusterInfoStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoBillingType?), TypeInfoPropertyName = "NullableGPUClusterInfoBillingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequestClusterType?), TypeInfoPropertyName = "NullableGPUClusterUpdateRequestClusterType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InstanceTypesResponseType?), TypeInfoPropertyName = "NullableInstanceTypesResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel?), TypeInfoPropertyName = "NullableAcceptanceTestsParamsDcgmDiagLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequestMode?), TypeInfoPropertyName = "NullableApproveRemediationRequestMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterPhaseTransitionPhase?), TypeInfoPropertyName = "NullableClusterPhaseTransitionPhase2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InstanceClusterConfigLoadBalancer?), TypeInfoPropertyName = "NullableInstanceClusterConfigLoadBalancer2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.NodePhaseTransitionPhase?), TypeInfoPropertyName = "NullableNodePhaseTransitionPhase2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity?), TypeInfoPropertyName = "NullablePassiveHealthCheckAlertSeverity2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode?), TypeInfoPropertyName = "NullableRemediationMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger?), TypeInfoPropertyName = "NullableRemediationTrigger2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState?), TypeInfoPropertyName = "NullableRemediationState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeStatus?), TypeInfoPropertyName = "NullableGPUClustersSharedVolumeStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfRerankRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequestModel?), TypeInfoPropertyName = "NullableRerankRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf, global::System.Collections.Generic.IList>?), TypeInfoPropertyName = "NullableOneOfIListObjectIListString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinishReason?), TypeInfoPropertyName = "NullableFinishReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCompletionRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestModel?), TypeInfoPropertyName = "NullableCompletionRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCompletionRequestSafetyModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestSafetyModel?), TypeInfoPropertyName = "NullableCompletionRequestSafetyModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionStream?), TypeInfoPropertyName = "NullableCompletionStream2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfUsageDataObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfFinishReasonObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDeltaRole?), TypeInfoPropertyName = "NullableCompletionChoiceDeltaRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfObjectLogprobsPart2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageRole?), TypeInfoPropertyName = "NullableChatCompletionMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolType?), TypeInfoPropertyName = "NullableChatCompletionToolType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageParam?), TypeInfoPropertyName = "NullableChatCompletionMessageParam2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior?), TypeInfoPropertyName = "NullableChatCompletionRequestContextLengthExceededBehavior2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfChatCompletionRequestFunctionCallEnumChatCompletionRequestFunctionCallEnum22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum?), TypeInfoPropertyName = "NullableChatCompletionRequestFunctionCallEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormat?), TypeInfoPropertyName = "NullableResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType?), TypeInfoPropertyName = "NullableChatCompletionRequestResponseFormatDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringToolChoice22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoningEffort?), TypeInfoPropertyName = "NullableChatCompletionRequestReasoningEffort2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatTextType?), TypeInfoPropertyName = "NullableResponseFormatTextType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObjectType?), TypeInfoPropertyName = "NullableResponseFormatJsonObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaType?), TypeInfoPropertyName = "NullableResponseFormatJsonSchemaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionSystemMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionUserMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVariant1Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVariant2Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVideoType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemAudioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionAssistantMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionFunctionMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionToolMessageParamRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream?), TypeInfoPropertyName = "NullableChatCompletionStream2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole?), TypeInfoPropertyName = "NullableChatCompletionChunkChoiceDeltaRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfAudioSpeechRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel?), TypeInfoPropertyName = "NullableAudioSpeechRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioSpeechRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseEncoding?), TypeInfoPropertyName = "NullableAudioSpeechRequestResponseEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfByteArrayString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestModel?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfAudioTranscriptionRequestTimestampGranularitiesIListAudioTranscriptionRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularities?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestTimestampGranularities2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionResponse?), TypeInfoPropertyName = "NullableAudioTranscriptionResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestModel?), TypeInfoPropertyName = "NullableAudioTranslationRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioTranslationRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfAudioTranslationRequestTimestampGranularitiesIListAudioTranslationRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularities?), TypeInfoPropertyName = "NullableAudioTranslationRequestTimestampGranularities2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularitie?), TypeInfoPropertyName = "NullableAudioTranslationRequestTimestampGranularitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationResponse?), TypeInfoPropertyName = "NullableAudioTranslationResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechStreamResponse?), TypeInfoPropertyName = "NullableAudioSpeechStreamResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData?), TypeInfoPropertyName = "NullableStreamSentinelData2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoiceDeltaRole?), TypeInfoPropertyName = "NullableChatCompletionChoiceDeltaRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfEmbeddingsRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequestModel?), TypeInfoPropertyName = "NullableEmbeddingsRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfStringIListString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelInfoType?), TypeInfoPropertyName = "NullableModelInfoType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadRequestModelType?), TypeInfoPropertyName = "NullableModelUploadRequestModelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DataItem3?), TypeInfoPropertyName = "NullableDataItem32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminatorType?), TypeInfoPropertyName = "NullableImageResponseDataItemDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64Type?), TypeInfoPropertyName = "NullableImageResponseDataB64Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrlType?), TypeInfoPropertyName = "NullableImageResponseDataUrlType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponseStatus?), TypeInfoPropertyName = "NullableJobInfoSuccessResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType?), TypeInfoPropertyName = "NullableToolChoiceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FilePurpose?), TypeInfoPropertyName = "NullableFilePurpose2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileType?), TypeInfoPropertyName = "NullableFileType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileProcessingStatus?), TypeInfoPropertyName = "NullableFileProcessingStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReportErrorType?), TypeInfoPropertyName = "NullableFileValidationReportErrorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfInt32FinetuneResponseBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseBatchSize?), TypeInfoPropertyName = "NullableFinetuneResponseBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanFinetuneResponseTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseTrainOnInputs?), TypeInfoPropertyName = "NullableFinetuneResponseTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfTrainingMethodSFTTrainingMethodDPO2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfFullTrainingTypeLoRATrainingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneJobStatus?), TypeInfoPropertyName = "NullableFinetuneJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequestTrainingMethod?), TypeInfoPropertyName = "NullableFineTunePreviewRequestTrainingMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponseDatasetFormat?), TypeInfoPropertyName = "NullableFineTunePreviewResponseDatasetFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventLevels?), TypeInfoPropertyName = "NullableFinetuneEventLevels2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventType?), TypeInfoPropertyName = "NullableFinetuneEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpointCheckpoint?), TypeInfoPropertyName = "NullableFineTuneCheckpointCheckpoint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FullTrainingTypeType?), TypeInfoPropertyName = "NullableFullTrainingTypeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LoRATrainingTypeType?), TypeInfoPropertyName = "NullableLoRATrainingTypeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTMethod?), TypeInfoPropertyName = "NullableTrainingMethodSFTMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanTrainingMethodSFTTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTTrainOnInputs?), TypeInfoPropertyName = "NullableTrainingMethodSFTTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodDPOMethod?), TypeInfoPropertyName = "NullableTrainingMethodDPOMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LRSchedulerLrSchedulerType?), TypeInfoPropertyName = "NullableLRSchedulerLrSchedulerType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfLinearLRSchedulerArgsCosineLRSchedulerArgs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareAvailabilityStatus?), TypeInfoPropertyName = "NullableHardwareAvailabilityStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateEndpointRequestState?), TypeInfoPropertyName = "NullableCreateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointType?), TypeInfoPropertyName = "NullableDedicatedEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointState?), TypeInfoPropertyName = "NullableDedicatedEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointType?), TypeInfoPropertyName = "NullableListEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointState?), TypeInfoPropertyName = "NullableListEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Error?), TypeInfoPropertyName = "NullableError2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorOutputType?), TypeInfoPropertyName = "NullableErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestFileEncoding?), TypeInfoPropertyName = "NullableExecuteRequestFileEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestLanguage?), TypeInfoPropertyName = "NullableExecuteRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponse?), TypeInfoPropertyName = "NullableExecuteResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OutputsItem?), TypeInfoPropertyName = "NullableOutputsItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutput?), TypeInfoPropertyName = "NullableInterpreterOutput2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputStreamOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputErrorOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDiscriminatorType?), TypeInfoPropertyName = "NullableInterpreterOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponse?), TypeInfoPropertyName = "NullableSessionListResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamOutputType?), TypeInfoPropertyName = "NullableStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequestEndpoint?), TypeInfoPropertyName = "NullableCreateBatchRequestEndpoint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJobStatus?), TypeInfoPropertyName = "NullableBatchJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationTypedRequestType?), TypeInfoPropertyName = "NullableEvaluationTypedRequestType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyParametersEvaluationScoreParametersEvaluationCompareParameters2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelOrString?), TypeInfoPropertyName = "NullableEvaluationModelOrString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationModelRequestString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfigModelSource?), TypeInfoPropertyName = "NullableEvaluationJudgeModelConfigModelSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequestModelSource?), TypeInfoPropertyName = "NullableEvaluationModelRequestModelSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponseStatus?), TypeInfoPropertyName = "NullableEvaluationResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobType?), TypeInfoPropertyName = "NullableEvaluationJobType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobStatus?), TypeInfoPropertyName = "NullableEvaluationJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResultsEvaluationJobResults2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoOutputFormat?), TypeInfoPropertyName = "NullableVideoOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoStatus?), TypeInfoPropertyName = "NullableVideoStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfDoubleVideoFrameImageInputFrame2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInputFrame?), TypeInfoPropertyName = "NullableVideoFrameImageInputFrame2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringVideoRef2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringAudioRef2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfHTTPAutoscalingConfigQueueAutoscalingConfigCustomMetricAutoscalingConfig2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestGpuType?), TypeInfoPropertyName = "NullableCreateDeploymentRequestGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType?), TypeInfoPropertyName = "NullableVolumeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemGpuType?), TypeInfoPropertyName = "NullableDeploymentResponseItemGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentStatus?), TypeInfoPropertyName = "NullableDeploymentStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableHTTPAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableQueueAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableCustomMetricAutoscalingConfigMetric2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestGpuType?), TypeInfoPropertyName = "NullableUpdateDeploymentRequestGpuType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType?), TypeInfoPropertyName = "NullableVolumeContentRequestType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType?), TypeInfoPropertyName = "NullableVolumeContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus?), TypeInfoPropertyName = "NullableQueueCancelResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus?), TypeInfoPropertyName = "NullableQueueJobStatusResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCreateImagesGenerationsRequestModelString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestResponseFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfInt32CreateFineTunesRequestBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize?), TypeInfoPropertyName = "NullableCreateFineTunesRequestBatchSize2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanCreateFineTunesRequestTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestTrainOnInputs?), TypeInfoPropertyName = "NullableCreateFineTunesRequestTrainOnInputs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfFullTrainingTypeLoRATrainingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequestState?), TypeInfoPropertyName = "NullableUpdateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter?), TypeInfoPropertyName = "NullableRolloutServiceListRolloutsFilter2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsMinLevel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsSourceKind?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsSourceKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeServiceListModelsVisibility?), TypeInfoPropertyName = "NullableVolumeServiceListModelsVisibility2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsModality?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsModality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsProduct2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint?), TypeInfoPropertyName = "NullableGetFinetuneDownloadCheckpoint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel?), TypeInfoPropertyName = "NullableRealtimeTtsModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsType?), TypeInfoPropertyName = "NullableListEndpointsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsUsageType?), TypeInfoPropertyName = "NullableListEndpointsUsageType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat?), TypeInfoPropertyName = "NullableRealtimeTranscriptionInputAudioFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu?), TypeInfoPropertyName = "NullableListModelResourcesStatu2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListTrainingSessionsStatu?), TypeInfoPropertyName = "NullableListTrainingSessionsStatu2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsStateItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsStateItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsTriggerItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsTriggerItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsModeItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsModeItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus?), TypeInfoPropertyName = "NullableHealthCheckServiceListPassiveHealthCheckAlertsStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem?), TypeInfoPropertyName = "NullableHealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfCreateFineTunesEstimatePriceResponseVariant1CreateFineTunesEstimatePriceResponseVariant22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason?), TypeInfoPropertyName = "NullableCreateFineTunesEstimatePriceResponseVariant2UnavailableReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfFineTunePreviewMessageErrorFineTunePreviewDetailError2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus?), TypeInfoPropertyName = "NullableGetEvaluationJobStatusAndResultsResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResults2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -2062,12 +4358,14 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -2098,6 +4396,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -2115,13 +4416,21 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext + internal sealed partial class SourceGenerationContextChunk2 : global::System.Text.Json.Serialization.JsonSerializerContext { } /// @@ -2132,7 +4441,9 @@ public sealed partial class SourceGenerationContext : global::System.Text.Json.S private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = global::System.Text.Json.Serialization.Metadata.JsonTypeInfoResolver.Combine( SourceGenerationContextChunk0.Default, - SourceGenerationContextChunk1.Default + SourceGenerationContextChunk1.Default, + + SourceGenerationContextChunk2.Default ); private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); @@ -2163,20 +4474,126 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, TypeInfoResolver = Resolver, }; + options.Converters.Add(new global::Together.JsonConverters.DeEndpointVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEndpointTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentSummaryTrafficModeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentSummaryStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCreateEndpointRequestVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointUpdateVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentTrafficModeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentAdapterStatusStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricRuleStatJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricRuleStatNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeThresholdCheckOperatorNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRegressionCheckDirectionNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCancelRolloutRequestDispositionNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStrategyJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStrategyNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutConditionCategoryNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRolloutStepStatusStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultStatJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultStatNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultCheckJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultCheckNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultOperatorJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultOperatorNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultDirectionJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultDirectionNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultVerdictJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeMetricResultVerdictNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeABExperimentMemberRoleNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeInlinePlacementConstraintNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelInputModalitieJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelInputModalitieNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelOutputModalitieJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelOutputModalitieNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelProductJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelProductNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelFeatureJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelFeatureNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelCapabilitieJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelCapabilitieNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeSupportedModelStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeUpdateModelRequestVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeHeadroomRelationJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeHeadroomRelationNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRemoteUploadStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeRemoteUploadEventLevelNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeDeploymentStatusStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEventLevelJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEventLevelNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeEndpointEventSourceKindNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeConfigEngineTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeConfigEngineTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeConfigDeploymentFrameworkJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeConfigDeploymentFrameworkNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCertificationTargetJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCertificationTargetNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeCertificationCertificationTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeScalingMetricTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlModelResourcesStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlModelResourcesStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlModelResourcesErrorCodeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlDTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlDTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlLossTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlLossTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlWeightSyncTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlWeightSyncTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlGRPOLossAggregationTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlGRPOLossRatioTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingOperationErrorCodeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingOperationErrorCodeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingOperationStatusJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingOperationStatusNullableJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.RlSessionTypeJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.RlSessionTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingSessionStatusJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlTrainingSessionStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlTrainingSessionErrorCodeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RlMuonScalingStrategyNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlCheckpointVariantJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RlCheckpointVariantNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.GPUClusterCreateRequestClusterTypeJsonConverter()); @@ -2199,12 +4616,16 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.InstanceTypesResponseTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ApproveRemediationRequestModeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ClusterPhaseTransitionPhaseJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ClusterPhaseTransitionPhaseNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.InstanceClusterConfigLoadBalancerJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.InstanceClusterConfigLoadBalancerNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.NodePhaseTransitionPhaseJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.NodePhaseTransitionPhaseNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RemediationModeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RemediationModeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RemediationTriggerJsonConverter()); @@ -2307,6 +4728,10 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.JobInfoSuccessResponseStatusNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ToolChoiceTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FileProcessingStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FileProcessingStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FileValidationReportErrorTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FilePurposeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FilePurposeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FileTypeJsonConverter()); @@ -2315,12 +4740,18 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.FinetuneResponseBatchSizeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneResponseTrainOnInputsJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneResponseTrainOnInputsNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneJobStatusJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneJobStatusNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneEventLevelsJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneEventLevelsNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneEventTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FinetuneEventTypeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.FineTuneCheckpointCheckpointNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FullTrainingTypeTypeJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.FullTrainingTypeTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.LoRATrainingTypeTypeJsonConverter()); @@ -2431,6 +4862,18 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.UpdateEndpointRequestStateJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.UpdateEndpointRequestStateNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RolloutServiceListRolloutsFilterNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.VolumeServiceListModelsVisibilityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.VolumeServiceListModelsVisibilityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.GetFinetuneDownloadCheckpointJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.GetFinetuneDownloadCheckpointNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RealtimeTtsModelJsonConverter()); @@ -2441,12 +4884,28 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.ListEndpointsUsageTypeNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ListModelResourcesStatuJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ListModelResourcesStatuNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ListTrainingSessionsStatuJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ListTrainingSessionsStatuNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsStateItemJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsStateItemNullableJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsModeJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsModeNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsModeItemJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.RemediationServiceListRemediationsModeItemNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusNullableJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DePlacementJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.DeAutoscalingResponseJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.CompletionStreamJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ResponseFormatJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.ChatCompletionMessageParamJsonConverter()); @@ -2502,6 +4961,8 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); @@ -2516,6 +4977,8 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); diff --git a/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs b/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs index 491f2397..982259cc 100644 --- a/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs +++ b/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs @@ -28,2675 +28,4247 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Together.RlOptimStepBody? Type0 { get; set; } + public global::Together.DeListPublicEndpointsResponse? Type0 { get; set; } /// /// /// - public float? Type1 { get; set; } + public global::System.Collections.Generic.IList? Type1 { get; set; } /// /// /// - public global::Together.RlAdamWOptimizerParams? Type2 { get; set; } + public global::Together.DePublicEndpoint? Type2 { get; set; } /// /// /// - public global::Together.RlSampleBody? Type3 { get; set; } + public string? Type3 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type4 { get; set; } + public global::System.DateTime? Type4 { get; set; } /// /// /// - public global::Together.RlModelInput? Type5 { get; set; } + public global::Together.DeListEndpointsResponse? Type5 { get; set; } /// /// /// - public global::Together.RlSamplingParams? Type6 { get; set; } + public global::System.Collections.Generic.IList? Type6 { get; set; } /// /// /// - public long? Type7 { get; set; } + public global::Together.DeEndpoint? Type7 { get; set; } /// /// /// - public global::Together.RlForwardBackwardBody? Type8 { get; set; } + public global::System.Collections.Generic.IList? Type8 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type9 { get; set; } + public global::Together.DeTrafficSplitEntry? Type9 { get; set; } /// /// /// - public global::Together.RlTrainingSample? Type10 { get; set; } + public global::Together.DeEndpointVisibility? Type10 { get; set; } /// /// /// - public global::Together.RlLossConfig? Type11 { get; set; } + public global::Together.DeEndpointEndpointType? Type11 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type12 { get; set; } + public global::System.Collections.Generic.IList? Type12 { get; set; } /// /// /// - public global::Together.RlInputChunk? Type13 { get; set; } + public global::Together.DeDeploymentSummary? Type13 { get; set; } /// /// /// - public int? Type14 { get; set; } + public global::Together.DeDeploymentSummaryTrafficMode? Type14 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::Together.DeDeploymentSummaryState? Type15 { get; set; } /// /// /// - public string? Type16 { get; set; } + public global::Together.DeAutoscalingResponse? Type16 { get; set; } /// /// /// - public global::Together.OneOf? Type17 { get; set; } + public int? Type17 { get; set; } /// /// /// - public global::Together.RlEncodedText? Type18 { get; set; } + public double? Type18 { get; set; } /// /// /// - public global::Together.RlListMeta? Type19 { get; set; } + public global::Together.DeCreateEndpointRequest? Type19 { get; set; } /// /// /// - public bool? Type20 { get; set; } + public global::Together.DeCreateEndpointRequestVisibility? Type20 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type21 { get; set; } + public global::Together.DeEndpointUpdate? Type21 { get; set; } /// /// /// - public global::Together.RlDType? Type22 { get; set; } + public global::Together.DeEndpointUpdateVisibility? Type22 { get; set; } /// /// /// - public global::Together.RlLossType? Type23 { get; set; } + public global::Together.DeCreateDeploymentRequest? Type23 { get; set; } /// /// /// - public global::Together.RlCrossEntropyLossParams? Type24 { get; set; } + public global::Together.DeAutoscaling? Type24 { get; set; } /// /// /// - public global::Together.RlGRPOLossParams? Type25 { get; set; } + public bool? Type25 { get; set; } /// /// /// - public global::Together.RlGRPOLossAggregationType? Type26 { get; set; } + public global::Together.DePlacement? Type26 { get; set; } /// /// /// - public global::Together.RlLossTargetTokens? Type27 { get; set; } + public global::Together.DeUpdateDeploymentRequest? Type27 { get; set; } /// /// /// - public global::Together.RlLossMask? Type28 { get; set; } + public global::Together.DeCreateABExperimentRequest? Type28 { get; set; } /// /// /// - public global::Together.RlLossAdvantages? Type29 { get; set; } + public global::System.Collections.Generic.IList? Type29 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type30 { get; set; } + public global::Together.DeABExperimentMember? Type30 { get; set; } /// /// /// - public global::Together.RlLossLogprobs? Type31 { get; set; } + public global::Together.DeUpdateABExperimentRequest? Type31 { get; set; } /// /// /// - public global::Together.RlGRPOLossInputs? Type32 { get; set; } + public global::Together.DeCreateRemoteUploadSpec? Type32 { get; set; } /// /// /// - public global::Together.RlLossInputs? Type33 { get; set; } + public global::Together.DeListFilesResponse? Type33 { get; set; } /// /// /// - public global::Together.RlOptimStepOperation? Type34 { get; set; } + public global::System.Collections.Generic.IList? Type34 { get; set; } /// /// /// - public global::Together.RlTrainingOperationStatus? Type35 { get; set; } + public global::Together.DeListFilesResponseFile? Type35 { get; set; } /// /// /// - public global::Together.RlOptimStepResult? Type36 { get; set; } + public global::Together.DeDeleteResponse? Type36 { get; set; } /// /// /// - public global::Together.RlTrainingOperationError? Type37 { get; set; } + public global::Together.DeListEndpointAccessResponse? Type37 { get; set; } /// /// /// - public global::Together.RlSampleOperation? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type38 { get; set; } /// /// /// - public global::Together.RlSampleResult? Type39 { get; set; } + public global::Together.DeAccessEntry? Type39 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type40 { get; set; } + public global::Together.DeListInferenceInstanceTypesResponse? Type40 { get; set; } /// /// /// - public global::Together.RlSampleRollout? Type41 { get; set; } + public global::System.Collections.Generic.IList? Type41 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type42 { get; set; } + public global::Together.DeInferenceInstanceType? Type42 { get; set; } /// /// /// - public global::Together.RlSampleSequence? Type43 { get; set; } + public global::Together.DeRevokeEndpointAccessResponse? Type43 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type44 { get; set; } + public global::Together.DeListRemoteUploadsResponse? Type44 { get; set; } /// /// /// - public double? Type45 { get; set; } + public global::System.Collections.Generic.IList? Type45 { get; set; } /// /// /// - public global::Together.RlForwardBackwardOperation? Type46 { get; set; } + public global::Together.DeRemoteUpload? Type46 { get; set; } /// /// /// - public global::Together.RlForwardBackwardResult? Type47 { get; set; } + public global::Together.DeListPlacementProfilesResponse? Type47 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type48 { get; set; } + public global::System.Collections.Generic.IList? Type48 { get; set; } /// /// /// - public global::Together.RlTrainingOperationErrorCode? Type49 { get; set; } + public global::Together.DePlacementProfile? Type49 { get; set; } /// /// /// - public global::Together.RlStartTrainingSessionRequest? Type50 { get; set; } + public global::System.Collections.Generic.IList? Type50 { get; set; } /// /// /// - public global::Together.RlSessionType? Type51 { get; set; } + public global::Together.DeListRemoteUploadEventsResponse? Type51 { get; set; } /// /// /// - public global::Together.RlLoraConfig? Type52 { get; set; } + public global::System.Collections.Generic.IList? Type52 { get; set; } /// /// /// - public global::Together.RlTrainingSessionStatus? Type53 { get; set; } + public global::Together.DeRemoteUploadEvent? Type53 { get; set; } /// /// /// - public global::Together.RlTrainingSession? Type54 { get; set; } + public global::Together.DeRevokeEndpointAccessRequest? Type54 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type55 { get; set; } + public global::Together.DeGrantEndpointAccessRequest? Type55 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpoint? Type56 { get; set; } + public global::Together.DeDeployment? Type56 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type57 { get; set; } + public global::Together.DeDeploymentTrafficMode? Type57 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpoint? Type58 { get; set; } + public global::Together.DeRuntimeInfo? Type58 { get; set; } /// /// /// - public global::System.DateTime? Type59 { get; set; } + public global::Together.DeDeploymentStatus? Type59 { get; set; } /// /// /// - public global::Together.RlTrainingSessionsListResponse? Type60 { get; set; } + public global::Together.DeAdapterEntry? Type60 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type61 { get; set; } + public global::System.Collections.Generic.IList? Type61 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointOperation? Type62 { get; set; } + public global::Together.DeDeploymentAdapterStatus? Type62 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointResult? Type63 { get; set; } + public global::Together.DeDeploymentAdapterStatusState? Type63 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointRegistration? Type64 { get; set; } + public global::Together.DeListAdaptersResponse? Type64 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpointResult? Type65 { get; set; } + public global::System.Collections.Generic.IList? Type65 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpointOperation? Type66 { get; set; } + public global::Together.DeAddAdapterRequest? Type66 { get; set; } /// /// /// - public global::Together.RlCheckpointVariant? Type67 { get; set; } + public global::Together.DeUpdateAdapterRequest? Type67 { get; set; } /// /// /// - public global::Together.RlCheckpointFile? Type68 { get; set; } + public global::Together.DeListRolloutsResponse? Type68 { get; set; } /// /// /// - public global::Together.OneOf? Type69 { get; set; } + public global::System.Collections.Generic.IList? Type69 { get; set; } /// /// /// - public global::Together.RlCheckpointDownloadResponse? Type70 { get; set; } + public global::Together.DeRollout? Type70 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type71 { get; set; } + public global::Together.DeCreateRolloutRequest? Type71 { get; set; } /// /// /// - public global::Together.ErrorResponse? Type72 { get; set; } + public global::Together.DeCanaryConfig? Type72 { get; set; } /// /// /// - public global::Together.GPUClusterControlPlaneNode? Type73 { get; set; } + public global::Together.DeBlueGreenConfig? Type73 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type74 { get; set; } + public global::Together.DeRollingConfig? Type74 { get; set; } /// /// /// - public global::Together.NodePhaseTransition? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequest? Type76 { get; set; } + public global::Together.DeMetricRule? Type76 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestClusterType? Type77 { get; set; } + public global::Together.DeCreateRolloutRequestSourceCleanup? Type77 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestGpuType? Type78 { get; set; } + public object? Type78 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeCreateRequest? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestBillingType? Type80 { get; set; } + public global::Together.DeRolloutStep? Type80 { get; set; } /// /// /// - public global::Together.OIDCConfig? Type81 { get; set; } + public global::Together.DeMetricRuleStat? Type81 { get; set; } /// /// /// - public global::Together.AcceptanceTestsParams? Type82 { get; set; } + public global::Together.DeThresholdCheck? Type82 { get; set; } /// /// /// - public global::Together.InstanceClusterConfig? Type83 { get; set; } + public global::Together.DeRegressionCheck? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type84 { get; set; } + public global::Together.DeThresholdCheckOperator? Type84 { get; set; } /// /// /// - public global::Together.AddOnCreateRequest? Type85 { get; set; } + public global::Together.DeRegressionCheckDirection? Type85 { get; set; } /// /// /// - public global::Together.GPUClusterGPUWorkerNode? Type86 { get; set; } + public global::Together.DePauseRolloutRequest? Type86 { get; set; } /// /// /// - public global::Together.Remediation? Type87 { get; set; } + public global::Together.DeResumeRolloutRequest? Type87 { get; set; } /// /// /// - public global::Together.GPUClusterInfo? Type88 { get; set; } + public global::Together.DeCancelRolloutRequest? Type88 { get; set; } /// /// /// - public global::Together.GPUClusterInfoClusterType? Type89 { get; set; } + public global::Together.DeCancelRolloutRequestDisposition? Type89 { get; set; } /// /// /// - public global::Together.GPUClusterInfoGpuType? Type90 { get; set; } + public global::Together.DePromoteRolloutRequest? Type90 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type91 { get; set; } + public global::Together.DePauseInfo? Type91 { get; set; } /// /// /// - public global::Together.GPUClusterVolume? Type92 { get; set; } + public global::Together.DeRolloutStrategy? Type92 { get; set; } /// /// /// - public global::Together.GPUClusterInfoStatus? Type93 { get; set; } + public global::Together.DeRolloutState? Type93 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type94 { get; set; } + public global::Together.DeRolloutStatus? Type94 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type95 { get; set; } + public global::Together.DeRolloutCondition? Type95 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type96 { get; set; } + public global::System.Collections.Generic.IList? Type96 { get; set; } /// /// /// - public global::Together.ClusterPhaseTransition? Type97 { get; set; } + public global::Together.DeRolloutStepStatus? Type97 { get; set; } /// /// /// - public global::Together.GPUClusterInfoBillingType? Type98 { get; set; } + public global::Together.DeRolloutConditionCategory? Type98 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type99 { get; set; } + public global::System.Collections.Generic.IList? Type99 { get; set; } /// /// /// - public global::Together.AddOnInfo? Type100 { get; set; } + public global::Together.DeMetricResult? Type100 { get; set; } /// /// /// - public global::Together.GPUClusterUpdateRequest? Type101 { get; set; } + public global::Together.DeRolloutStepStatusState? Type101 { get; set; } /// /// /// - public global::Together.GPUClusterUpdateRequestClusterType? Type102 { get; set; } + public global::Together.DeMetricResultStat? Type102 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type103 { get; set; } + public global::Together.DeMetricResultCheck? Type103 { get; set; } /// /// /// - public global::Together.AddOnUpdateRequest? Type104 { get; set; } + public global::Together.DeMetricResultOperator? Type104 { get; set; } /// /// /// - public global::Together.GPUClusters? Type105 { get; set; } + public global::Together.DeMetricResultDirection? Type105 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type106 { get; set; } + public global::Together.DeMetricResultVerdict? Type106 { get; set; } /// /// /// - public global::Together.InstanceTypesResponse? Type107 { get; set; } + public global::Together.DeABExperiment? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::Together.DeABExperimentMemberRole? Type108 { get; set; } /// /// /// - public global::Together.InstanceTypesResponseType? Type109 { get; set; } + public global::Together.DePlacementVariant1? Type109 { get; set; } /// /// /// - public global::Together.RegionListResponse? Type110 { get; set; } + public global::Together.DeInlinePlacement? Type110 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type111 { get; set; } + public global::Together.DePlacementVariant2? Type111 { get; set; } /// /// /// - public global::Together.RegionListResponseRegion? Type112 { get; set; } + public global::Together.DeInlinePlacementConstraint? Type112 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type113 { get; set; } + public global::Together.DeListModelsResponse? Type113 { get; set; } /// /// /// - public global::Together.ClusterDriverVersionInfo? Type114 { get; set; } + public global::System.Collections.Generic.IList? Type114 { get; set; } /// /// /// - public global::Together.AcceptanceTestsParamsDcgmDiagLevel? Type115 { get; set; } + public global::Together.DeModel? Type115 { get; set; } /// /// /// - public global::Together.AddOnConfig? Type116 { get; set; } + public global::Together.DeListSupportedModelsResponse? Type116 { get; set; } /// /// /// - public global::Together.DashboardConfig? Type117 { get; set; } + public global::System.Collections.Generic.IList? Type117 { get; set; } /// /// /// - public global::Together.IngressConfig? Type118 { get; set; } + public global::Together.DeSupportedModel? Type118 { get; set; } /// /// /// - public global::Together.AddOnState? Type119 { get; set; } + public global::Together.DeSupportedModelDeploymentProfile? Type119 { get; set; } /// /// /// - public global::Together.DashboardState? Type120 { get; set; } + public global::Together.DeSupportedModelPerformanceBenchmarks? Type120 { get; set; } /// /// /// - public global::Together.IngressState? Type121 { get; set; } + public global::System.Collections.Generic.IList? Type121 { get; set; } /// /// /// - public global::Together.CommentBody? Type122 { get; set; } + public global::Together.DeSupportedModelInputModalitie? Type122 { get; set; } /// /// /// - public global::Together.ClusterAddOnCreateRequest? Type123 { get; set; } + public global::System.Collections.Generic.IList? Type123 { get; set; } /// /// /// - public global::Together.ClusterAddOnDeleteResponse? Type124 { get; set; } + public global::Together.DeSupportedModelOutputModalitie? Type124 { get; set; } /// /// /// - public global::Together.ClusterAddOnUpdateRequest? Type125 { get; set; } + public global::System.Collections.Generic.IList? Type125 { get; set; } /// /// /// - public global::Together.ClusterAddOnsListResponse? Type126 { get; set; } + public global::Together.DeSupportedModelProduct? Type126 { get; set; } /// /// /// - public global::Together.ClusterIngressConfig? Type127 { get; set; } + public global::System.Collections.Generic.IList? Type127 { get; set; } /// /// /// - public global::Together.ClusterPhaseTransitionPhase? Type128 { get; set; } + public global::Together.DeSupportedModelFeature? Type128 { get; set; } /// /// /// - public global::Together.GPUClusterDeleteResponse? Type129 { get; set; } + public global::System.Collections.Generic.IList? Type129 { get; set; } /// /// /// - public global::Together.InstanceClusterConfigLoadBalancer? Type130 { get; set; } + public global::Together.DeSupportedModelCapabilitie? Type130 { get; set; } /// /// /// - public global::Together.SlurmStartupScripts? Type131 { get; set; } + public global::Together.DeSupportedModelStatus? Type131 { get; set; } /// /// /// - public global::Together.ObservabilityConfig? Type132 { get; set; } + public global::System.Collections.Generic.IList? Type132 { get; set; } /// /// /// - public global::Together.ListRemediationsResponse? Type133 { get; set; } + public global::Together.DeListEndpointEventsResponse? Type133 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type134 { get; set; } + public global::System.Collections.Generic.IList? Type134 { get; set; } /// /// /// - public global::Together.NodePhaseTransitionPhase? Type135 { get; set; } + public global::Together.DeEndpointEvent? Type135 { get; set; } /// /// /// - public global::Together.RemediationMode? Type136 { get; set; } + public global::Together.DeListRevisionsResponse? Type136 { get; set; } /// /// /// - public global::Together.RemediationTrigger? Type137 { get; set; } + public global::System.Collections.Generic.IList? Type137 { get; set; } /// /// /// - public global::Together.RemediationState? Type138 { get; set; } + public global::Together.DeListRevisionsResponseRevision? Type138 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeDeleteResponse? Type139 { get; set; } + public global::Together.DeListProjectConfigsResponse? Type139 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolume? Type140 { get; set; } + public global::System.Collections.Generic.IList? Type140 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeStatus? Type141 { get; set; } + public global::Together.DeModelConfig? Type141 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeUpdateRequest? Type142 { get; set; } + public global::Together.DeListDeploymentsResponse? Type142 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumes? Type143 { get; set; } + public global::System.Collections.Generic.IList? Type143 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type144 { get; set; } + public global::Together.DeListABExperimentsResponse? Type144 { get; set; } /// /// /// - public global::Together.ListVoicesResponse? Type145 { get; set; } + public global::System.Collections.Generic.IList? Type145 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type146 { get; set; } + public global::Together.DeCreateShadowExperimentRequest? Type146 { get; set; } /// /// /// - public global::Together.ModelVoices? Type147 { get; set; } + public global::Together.DeShadowExperimentSource? Type147 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type148 { get; set; } + public global::System.Collections.Generic.IList? Type148 { get; set; } /// /// /// - public global::Together.ModelVoicesVoice? Type149 { get; set; } + public global::Together.DeCreateShadowExperimentTargetRequest? Type149 { get; set; } /// /// /// - public global::Together.ListAvailibilityZonesResponse? Type150 { get; set; } + public global::Together.DeUpdateShadowExperimentRequest? Type150 { get; set; } /// /// /// - public global::Together.RerankRequest? Type151 { get; set; } + public global::Together.DeUpdateShadowExperimentTargetRequest? Type151 { get; set; } /// /// /// - public global::Together.AnyOf? Type152 { get; set; } + public global::Together.DeListShadowExperimentsResponse? Type152 { get; set; } /// /// /// - public global::Together.RerankRequestModel? Type153 { get; set; } + public global::System.Collections.Generic.IList? Type153 { get; set; } /// /// /// - public global::Together.OneOf, global::System.Collections.Generic.IList>? Type154 { get; set; } + public global::Together.DeShadowExperiment? Type154 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type155 { get; set; } + public global::Together.DeListShadowExperimentTargetsResponse? Type155 { get; set; } /// /// /// - public object? Type156 { get; set; } + public global::System.Collections.Generic.IList? Type156 { get; set; } /// /// /// - public global::Together.RerankResponse? Type157 { get; set; } + public global::Together.DeShadowExperimentTarget? Type157 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::Together.DeShadowExperimentSourceResponse? Type158 { get; set; } /// /// /// - public global::Together.RerankResponseResult? Type159 { get; set; } + public global::Together.DeShadowExperimentState? Type159 { get; set; } /// /// /// - public global::Together.RerankResponseResultDocument? Type160 { get; set; } + public global::Together.DeShadowExperimentEndpointSource? Type160 { get; set; } /// /// /// - public global::Together.UsageData? Type161 { get; set; } + public global::Together.DeShadowExperimentSampling? Type161 { get; set; } /// /// /// - public global::Together.ErrorData? Type162 { get; set; } + public global::Together.DeShadowExperimentEndpointSourceResponse? Type162 { get; set; } /// /// /// - public global::Together.ErrorDataError? Type163 { get; set; } + public global::Together.DeShadowExperimentSamplingResponse? Type163 { get; set; } /// /// /// - public global::Together.FinishReason? Type164 { get; set; } + public global::Together.DeShadowExperimentSamplingResponseVariant1? Type164 { get; set; } /// /// /// - public global::Together.LogprobsPart? Type165 { get; set; } + public global::Together.DeShadowExperimentUniformSamplingResponse? Type165 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type166 { get; set; } + public global::Together.DeShadowExperimentSamplingResponseVariant2? Type166 { get; set; } /// /// /// - public global::Together.PromptPartItem? Type167 { get; set; } + public global::Together.DeShadowExperimentKeyBasedSamplingResponse? Type167 { get; set; } /// /// /// - public global::Together.InferenceWarning? Type168 { get; set; } + public global::Together.DeShadowExperimentSamplingResponseVariant3? Type168 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type169 { get; set; } + public global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse? Type169 { get; set; } /// /// /// - public global::Together.CompletionChoicesDataItem? Type170 { get; set; } + public global::Together.DeShadowExperimentSamplingResponseVariant4? Type170 { get; set; } /// /// /// - public global::Together.CompletionRequest? Type171 { get; set; } + public global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse? Type171 { get; set; } /// /// /// - public global::Together.AnyOf? Type172 { get; set; } + public global::Together.DeShadowExperimentSamplingVariant1? Type172 { get; set; } /// /// /// - public global::Together.CompletionRequestModel? Type173 { get; set; } + public global::Together.DeShadowExperimentUniformSampling? Type173 { get; set; } /// /// /// - public global::Together.AnyOf? Type174 { get; set; } + public global::Together.DeShadowExperimentSamplingVariant2? Type174 { get; set; } /// /// /// - public global::Together.CompletionRequestSafetyModel? Type175 { get; set; } + public global::Together.DeShadowExperimentKeyBasedSampling? Type175 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type176 { get; set; } + public global::Together.DeShadowExperimentSamplingVariant3? Type176 { get; set; } /// /// /// - public global::Together.CompletionResponse? Type177 { get; set; } + public global::Together.DeShadowExperimentAdaptiveUniformSampling? Type177 { get; set; } /// /// /// - public global::Together.CompletionStream? Type178 { get; set; } + public global::Together.DeShadowExperimentSamplingVariant4? Type178 { get; set; } /// /// /// - public global::Together.CompletionEvent? Type179 { get; set; } + public global::Together.DeShadowExperimentAdaptiveKeyBasedSampling? Type179 { get; set; } /// /// /// - public global::Together.StreamSentinel? Type180 { get; set; } + public global::Together.DeUpdateModelRequest? Type180 { get; set; } /// /// /// - public global::Together.CompletionChunk? Type181 { get; set; } + public global::Together.DeUpdateModelRequestVisibility? Type181 { get; set; } /// /// /// - public global::Together.CompletionToken? Type182 { get; set; } + public global::Together.DeCreateModelRequest? Type182 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type183 { get; set; } + public global::System.Collections.Generic.IList? Type183 { get; set; } /// /// /// - public global::Together.CompletionChoice? Type184 { get; set; } + public global::Together.DeRegion? Type184 { get; set; } /// /// /// - public global::Together.AllOf? Type185 { get; set; } + public global::Together.DeHeadroom? Type185 { get; set; } /// /// /// - public global::Together.AllOf? Type186 { get; set; } + public global::Together.DeHeadroomRelation? Type186 { get; set; } /// /// /// - public global::Together.CompletionChoiceDelta? Type187 { get; set; } + public global::Together.DeAnalyticsData? Type187 { get; set; } /// /// /// - public global::Together.CompletionChoiceDeltaRole? Type188 { get; set; } + public global::Together.DeMetricsTimeRange? Type188 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type189 { get; set; } + public global::Together.DeEndpointMetrics? Type189 { get; set; } /// /// /// - public global::Together.ToolChoice2? Type190 { get; set; } + public global::System.Collections.Generic.IList? Type190 { get; set; } /// /// /// - public global::Together.CompletionChoiceDeltaFunctionCall? Type191 { get; set; } + public global::Together.DeTimeSeriesDataPoint? Type191 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type192 { get; set; } + public global::System.Collections.Generic.IList? Type192 { get; set; } /// /// /// - public global::Together.ChatCompletionChoicesDataItem? Type193 { get; set; } + public global::Together.DeDeploymentAnalyticsData? Type193 { get; set; } /// /// /// - public global::Together.ChatCompletionMessage? Type194 { get; set; } + public global::Together.DeRemoteUploadStatus? Type194 { get; set; } /// /// /// - public global::Together.AllOf? Type195 { get; set; } + public global::System.Collections.Generic.IList? Type195 { get; set; } /// /// /// - public global::Together.ChatCompletionMessageRole? Type196 { get; set; } + public global::Together.DeCertification? Type196 { get; set; } /// /// /// - public global::Together.ChatCompletionMessageFunctionCall? Type197 { get; set; } + public global::System.Collections.Generic.IList? Type197 { get; set; } /// /// /// - public global::Together.ChatCompletionTool? Type198 { get; set; } + public global::Together.DeSelector? Type198 { get; set; } /// /// /// - public global::Together.ChatCompletionToolType? Type199 { get; set; } + public global::Together.DeModelWeights? Type199 { get; set; } /// /// /// - public global::Together.ChatCompletionToolFunction? Type200 { get; set; } + public global::Together.DeModelVisibility? Type200 { get; set; } /// /// /// - public global::Together.ChatCompletionRequest? Type201 { get; set; } + public global::Together.DeRemoteUploadEventLevel? Type201 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type202 { get; set; } + public global::System.Collections.Generic.IList? Type202 { get; set; } /// /// /// - public global::Together.ChatCompletionMessageParam? Type203 { get; set; } + public global::Together.DeScalingMetric? Type203 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestContextLengthExceededBehavior? Type204 { get; set; } + public global::Together.DeDeploymentStatusState? Type204 { get; set; } /// /// /// - public global::Together.OneOf? Type205 { get; set; } + public global::Together.DeEndpointEventLevel? Type205 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestFunctionCallEnum? Type206 { get; set; } + public global::Together.DeEndpointEventSourceKind? Type206 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestFunctionCallEnum2? Type207 { get; set; } + public global::Together.DeListRevisionsResponseRevisionValidationStatus? Type207 { get; set; } /// /// /// - public global::Together.ResponseFormat? Type208 { get; set; } + public global::System.Collections.Generic.IList? Type208 { get; set; } /// /// /// - public global::Together.ResponseFormatText? Type209 { get; set; } + public global::Together.DeRevisionValidationError? Type209 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchema? Type210 { get; set; } + public global::Together.DeDeploymentMetrics? Type210 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonObject? Type211 { get; set; } + public global::Together.DeRequestMetrics? Type211 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestResponseFormatDiscriminator? Type212 { get; set; } + public global::Together.DeLatencyMetrics? Type212 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestResponseFormatDiscriminatorType? Type213 { get; set; } + public global::Together.DeThroughputMetrics? Type213 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type214 { get; set; } + public global::Together.DeErrorMetrics? Type214 { get; set; } /// /// /// - public global::Together.ToolsPart? Type215 { get; set; } + public global::Together.DeResourceUtilization? Type215 { get; set; } /// /// /// - public global::Together.OneOf? Type216 { get; set; } + public global::Together.DeTokenMetrics? Type216 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestReasoningEffort? Type217 { get; set; } + public global::System.Collections.Generic.IList? Type217 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestReasoning? Type218 { get; set; } + public global::System.Collections.Generic.Dictionary? Type218 { get; set; } /// /// /// - public global::Together.ResponseFormatTextType? Type219 { get; set; } + public global::Together.DeConfig? Type219 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonObjectType? Type220 { get; set; } + public global::Together.DeConfigEngineType? Type220 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaType? Type221 { get; set; } + public global::Together.DeConfigDeploymentFramework? Type221 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaJsonSchema? Type222 { get; set; } + public global::System.Collections.Generic.IList? Type222 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaSchema? Type223 { get; set; } + public global::Together.DeConfigSelector? Type223 { get; set; } /// /// /// - public global::Together.ChatCompletionSystemMessageParam? Type224 { get; set; } + public global::Together.DeCertificationTarget? Type224 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageParam? Type225 { get; set; } + public global::Together.DeCertificationCertificationType? Type225 { get; set; } /// /// /// - public global::Together.ChatCompletionAssistantMessageParam? Type226 { get; set; } + public global::Together.DeModelExternal? Type226 { get; set; } /// /// /// - public global::Together.ChatCompletionToolMessageParam? Type227 { get; set; } + public global::Together.DeModelLicense? Type227 { get; set; } /// /// /// - public global::Together.ChatCompletionFunctionMessageParam? Type228 { get; set; } + public global::Together.DeModelWeightsType? Type228 { get; set; } /// /// /// - public global::Together.ChatCompletionSystemMessageParamRole? Type229 { get; set; } + public global::Together.DeModelWeightsSpeculatorMechanism? Type229 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContent? Type230 { get; set; } + public global::Together.DeModelWeightsDraftSpeculatorType? Type230 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageParamRole? Type231 { get; set; } + public global::Together.DeModelParameters? Type231 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1? Type232 { get; set; } + public global::Together.DeScalingMetricType? Type232 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type? Type233 { get; set; } + public global::System.Collections.Generic.Dictionary? Type233 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2? Type234 { get; set; } + public global::System.Collections.Generic.IList? Type234 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type? Type235 { get; set; } + public global::Together.DeModelDTypeCount? Type235 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl? Type236 { get; set; } + public global::Together.RlOptimStepBody? Type236 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideo? Type237 { get; set; } + public global::Together.RlWeightSyncType? Type237 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType? Type238 { get; set; } + public float? Type238 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl? Type239 { get; set; } + public global::Together.RlAdamWOptimizerParams? Type239 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudio? Type240 { get; set; } + public global::Together.RlMuonOptimizerParams? Type240 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType? Type241 { get; set; } + public global::Together.RlSampleBody? Type241 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl? Type242 { get; set; } + public global::System.Collections.Generic.IList? Type242 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio? Type243 { get; set; } + public global::Together.RlModelInput? Type243 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType? Type244 { get; set; } + public global::Together.RlSamplingParams? Type244 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio? Type245 { get; set; } + public global::Together.RlForwardBackwardBody? Type245 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat? Type246 { get; set; } + public global::System.Collections.Generic.IList? Type246 { get; set; } /// /// /// - public global::Together.ChatCompletionAssistantMessageParamRole? Type247 { get; set; } + public global::Together.RlTrainingSample? Type247 { get; set; } /// /// /// - public global::Together.ChatCompletionAssistantMessageParamFunctionCall? Type248 { get; set; } + public global::Together.RlLossConfig? Type248 { get; set; } /// /// /// - public global::Together.ChatCompletionFunctionMessageParamRole? Type249 { get; set; } + public global::System.Collections.Generic.IList? Type249 { get; set; } /// /// /// - public global::Together.ChatCompletionToolMessageParamRole? Type250 { get; set; } + public global::Together.RlInputChunk? Type250 { get; set; } /// /// /// - public global::Together.ChatCompletionResponse? Type251 { get; set; } + public global::Together.OneOf? Type251 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type252 { get; set; } + public global::Together.RlEncodedText? Type252 { get; set; } /// /// /// - public global::Together.ChatCompletionStream? Type253 { get; set; } + public global::Together.RlListMeta? Type253 { get; set; } /// /// /// - public global::Together.ChatCompletionEvent? Type254 { get; set; } + public global::Together.RlModelFullModeConfig? Type254 { get; set; } /// /// /// - public global::Together.ChatCompletionChunk? Type255 { get; set; } + public global::Together.RlModelLoraModeConfig? Type255 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type256 { get; set; } + public global::Together.RlComputeConfig? Type256 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoice? Type257 { get; set; } + public global::Together.RlComputeConfigCreateRequest? Type257 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoiceDelta? Type258 { get; set; } + public global::Together.RlModelResourcesStatus? Type258 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoiceDeltaRole? Type259 { get; set; } + public global::Together.RlModelResources? Type259 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? Type260 { get; set; } + public global::Together.RlModelResourcesError? Type260 { get; set; } /// /// /// - public global::Together.AudioSpeechRequest? Type261 { get; set; } + public global::Together.RlOptimizerConfig? Type261 { get; set; } /// /// /// - public global::Together.AnyOf? Type262 { get; set; } + public global::Together.RlModelResourcesErrorCode? Type262 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestModel? Type263 { get; set; } + public global::Together.RlCreateModelResourcesRequest? Type263 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestResponseFormat? Type264 { get; set; } + public global::Together.RlModelResourcesEstimateCostResponse? Type264 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestResponseEncoding? Type265 { get; set; } + public global::Together.RlModelResourcesListResponse? Type265 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestExtraParams? Type266 { get; set; } + public global::System.Collections.Generic.IList? Type266 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequest? Type267 { get; set; } + public global::Together.RlModelTrainerConfig? Type267 { get; set; } /// /// /// - public global::Together.OneOf? Type268 { get; set; } + public global::Together.RlModelSamplingDefaults? Type268 { get; set; } /// /// /// - public byte[]? Type269 { get; set; } + public global::Together.RlModelGeneratorConfig? Type269 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestModel? Type270 { get; set; } + public global::Together.RlSupportedModel? Type270 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestResponseFormat? Type271 { get; set; } + public global::System.Collections.Generic.IList>? Type271 { get; set; } /// /// /// - public global::Together.OneOf>? Type272 { get; set; } + public global::Together.RlDType? Type272 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestTimestampGranularities? Type273 { get; set; } + public global::Together.RlLossType? Type273 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type274 { get; set; } + public global::Together.RlCrossEntropyLossParams? Type274 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestTimestampGranularitie? Type275 { get; set; } + public global::Together.RlGRPOLossParams? Type275 { get; set; } /// /// /// - public global::Together.AudioTranscriptionResponse? Type276 { get; set; } + public global::Together.RlGRPOLossAggregationType? Type276 { get; set; } /// /// /// - public global::Together.AudioTranscriptionJsonResponse? Type277 { get; set; } + public global::Together.RlGRPOLossRatioType? Type277 { get; set; } /// /// /// - public global::Together.AudioTranscriptionVerboseJsonResponse? Type278 { get; set; } + public global::Together.RlPPOLossParams? Type278 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type279 { get; set; } + public global::Together.RlCispoLossParams? Type279 { get; set; } /// /// /// - public global::Together.AudioTranscriptionSegment? Type280 { get; set; } + public global::Together.RlDroLossParams? Type280 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type281 { get; set; } + public global::Together.RlLossTargetTokens? Type281 { get; set; } /// /// /// - public global::Together.AudioTranscriptionWord? Type282 { get; set; } + public global::Together.RlLossMask? Type282 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type283 { get; set; } + public global::Together.RlLossAdvantages? Type283 { get; set; } /// /// /// - public global::Together.AudioTranscriptionSpeakerSegment? Type284 { get; set; } + public global::System.Collections.Generic.IList? Type284 { get; set; } /// /// /// - public global::Together.AudioTranslationRequest? Type285 { get; set; } + public global::Together.RlLossLogprobs? Type285 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestModel? Type286 { get; set; } + public global::Together.RlGRPOLossInputs? Type286 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestResponseFormat? Type287 { get; set; } + public global::Together.RlImportanceSamplingLossInputs? Type287 { get; set; } /// /// /// - public global::Together.OneOf>? Type288 { get; set; } + public global::Together.RlPPOLossInputs? Type288 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestTimestampGranularities? Type289 { get; set; } + public global::Together.RlCispoLossInputs? Type289 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type290 { get; set; } + public global::Together.RlDroLossInputs? Type290 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestTimestampGranularitie? Type291 { get; set; } + public global::Together.RlLossInputs? Type291 { get; set; } /// /// /// - public global::Together.AudioTranslationResponse? Type292 { get; set; } + public global::System.Collections.Generic.IList? Type292 { get; set; } /// /// /// - public global::Together.AudioTranslationJsonResponse? Type293 { get; set; } + public global::Together.RlPolicyVersionSegment? Type293 { get; set; } /// /// /// - public global::Together.AudioTranslationVerboseJsonResponse? Type294 { get; set; } + public global::Together.RlOptimStepOperation? Type294 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamResponse? Type295 { get; set; } + public global::Together.RlTrainingOperationStatus? Type295 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamEvent? Type296 { get; set; } + public global::Together.RlOptimStepResult? Type296 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamChunk? Type297 { get; set; } + public global::Together.RlTrainingOperationError? Type297 { get; set; } /// /// /// - public global::Together.StreamSentinelData? Type298 { get; set; } + public global::Together.RlSampleOperation? Type298 { get; set; } /// /// /// - public global::Together.ChatCompletionToken? Type299 { get; set; } + public global::Together.RlSampleResult? Type299 { get; set; } /// /// /// - public global::Together.ChatCompletionChoice? Type300 { get; set; } + public global::System.Collections.Generic.IList? Type300 { get; set; } /// /// /// - public global::Together.ChatCompletionChoiceDelta? Type301 { get; set; } + public global::Together.RlSampleRollout? Type301 { get; set; } /// /// /// - public global::Together.ChatCompletionChoiceDeltaRole? Type302 { get; set; } + public global::System.Collections.Generic.IList? Type302 { get; set; } /// /// /// - public global::Together.ChatCompletionChoiceDeltaFunctionCall? Type303 { get; set; } + public global::Together.RlSampleSequence? Type303 { get; set; } /// /// /// - public global::Together.EmbeddingsRequest? Type304 { get; set; } + public global::Together.RlForwardBackwardOperation? Type304 { get; set; } /// /// /// - public global::Together.AnyOf? Type305 { get; set; } + public global::Together.RlForwardBackwardResult? Type305 { get; set; } /// /// /// - public global::Together.EmbeddingsRequestModel? Type306 { get; set; } + public global::Together.RlCustomForwardBackwardBody? Type306 { get; set; } /// /// /// - public global::Together.OneOf>? Type307 { get; set; } + public global::System.Collections.Generic.IList? Type307 { get; set; } /// /// /// - public global::Together.EmbeddingsResponse? Type308 { get; set; } + public global::Together.RlTargetLogprobGradients? Type308 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type309 { get; set; } + public global::Together.RlCustomForwardBackwardOperation? Type309 { get; set; } /// /// /// - public global::Together.EmbeddingsResponseDataItem? Type310 { get; set; } + public global::Together.RlCustomForwardBackwardResult? Type310 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type311 { get; set; } + public global::Together.RlForwardBody? Type311 { get; set; } /// /// /// - public global::Together.ModelInfo? Type312 { get; set; } + public global::Together.RlForwardOperation? Type312 { get; set; } /// /// /// - public global::Together.ModelInfoType? Type313 { get; set; } + public global::Together.RlForwardResult? Type313 { get; set; } /// /// /// - public global::Together.Pricing? Type314 { get; set; } + public global::System.Collections.Generic.IList? Type314 { get; set; } /// /// /// - public global::Together.ModelUploadRequest? Type315 { get; set; } + public global::Together.RlTargetLogprobs? Type315 { get; set; } /// /// /// - public global::Together.ModelUploadRequestModelType? Type316 { get; set; } + public global::Together.RlTrainingOperationErrorCode? Type316 { get; set; } /// /// /// - public global::Together.ModelUploadSuccessResponse? Type317 { get; set; } + public global::Together.RlStartTrainingSessionRequest? Type317 { get; set; } /// /// /// - public global::Together.ModelUploadSuccessResponseData? Type318 { get; set; } + public global::Together.RlLoraConfig? Type318 { get; set; } /// /// /// - public global::Together.ImageResponse? Type319 { get; set; } + public global::Together.RlTrainingSessionStatus? Type319 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type320 { get; set; } + public global::Together.RlTrainingSessionError? Type320 { get; set; } /// /// /// - public global::Together.DataItem3? Type321 { get; set; } + public global::Together.RlTrainingSessionErrorCode? Type321 { get; set; } /// /// /// - public global::Together.ImageResponseDataB64? Type322 { get; set; } + public global::Together.RlTrainingSession? Type322 { get; set; } /// /// /// - public global::Together.ImageResponseDataUrl? Type323 { get; set; } + public global::System.Collections.Generic.IList? Type323 { get; set; } /// /// /// - public global::Together.ImageResponseDataItemDiscriminator? Type324 { get; set; } + public global::Together.RlInferenceCheckpoint? Type324 { get; set; } /// /// /// - public global::Together.ImageResponseDataItemDiscriminatorType? Type325 { get; set; } + public global::System.Collections.Generic.IList? Type325 { get; set; } /// /// /// - public global::Together.ImageResponseDataB64Type? Type326 { get; set; } + public global::Together.RlTrainingCheckpoint? Type326 { get; set; } /// /// /// - public global::Together.ImageResponseDataUrlType? Type327 { get; set; } + public global::Together.RlTrainingSessionsListResponse? Type327 { get; set; } /// /// /// - public global::Together.JobInfoSuccessResponse? Type328 { get; set; } + public global::System.Collections.Generic.IList? Type328 { get; set; } /// /// /// - public global::Together.JobInfoSuccessResponseStatus? Type329 { get; set; } + public global::Together.RlSupportedModelsListResponse? Type329 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type330 { get; set; } + public global::System.Collections.Generic.IList? Type330 { get; set; } /// /// /// - public global::Together.JobInfoSuccessResponseStatusUpdate? Type331 { get; set; } + public global::Together.RlAdamWOptimizerConfig? Type331 { get; set; } /// /// /// - public global::Together.JobInfoSuccessResponseArgs? Type332 { get; set; } + public global::Together.RlMuonOptimizerConfig? Type332 { get; set; } /// /// /// - public global::Together.JobsInfoSuccessResponse? Type333 { get; set; } + public global::Together.RlMuonScalingStrategy? Type333 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type334 { get; set; } + public global::Together.RlInferenceCheckpointOperation? Type334 { get; set; } /// /// /// - public global::Together.ToolsPartFunction? Type335 { get; set; } + public global::Together.RlInferenceCheckpointResult? Type335 { get; set; } /// /// /// - public global::Together.ToolChoiceType? Type336 { get; set; } + public global::Together.RlInferenceCheckpointRegistration? Type336 { get; set; } /// /// /// - public global::Together.ToolChoiceFunction? Type337 { get; set; } + public global::Together.RlTrainingCheckpointResult? Type337 { get; set; } /// /// /// - public global::Together.FileResponse? Type338 { get; set; } + public global::Together.RlTrainingCheckpointOperation? Type338 { get; set; } /// /// /// - public global::Together.FilePurpose? Type339 { get; set; } + public global::Together.RlCheckpointVariant? Type339 { get; set; } /// /// /// - public global::Together.FileType? Type340 { get; set; } + public global::Together.RlCheckpointFile? Type340 { get; set; } /// /// /// - public global::Together.FileList? Type341 { get; set; } + public global::Together.OneOf? Type341 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type342 { get; set; } + public long? Type342 { get; set; } /// /// /// - public global::Together.FileDeleteResponse? Type343 { get; set; } + public global::Together.RlCheckpointDownloadResponse? Type343 { get; set; } /// /// /// - public global::Together.FinetuneResponse? Type344 { get; set; } + public global::System.Collections.Generic.IList? Type344 { get; set; } /// /// /// - public global::System.Guid? Type345 { get; set; } + public global::Together.ErrorResponse? Type345 { get; set; } /// /// /// - public global::Together.OneOf? Type346 { get; set; } + public global::Together.GPUClusterControlPlaneNode? Type346 { get; set; } /// /// /// - public global::Together.FinetuneResponseBatchSize? Type347 { get; set; } + public global::System.Collections.Generic.IList? Type347 { get; set; } /// /// /// - public global::Together.LRScheduler? Type348 { get; set; } + public global::Together.NodePhaseTransition? Type348 { get; set; } /// /// /// - public global::Together.OneOf? Type349 { get; set; } + public global::Together.GPUClusterCreateRequest? Type349 { get; set; } /// /// /// - public global::Together.FinetuneResponseTrainOnInputs? Type350 { get; set; } + public global::Together.GPUClusterCreateRequestClusterType? Type350 { get; set; } /// /// /// - public global::Together.OneOf? Type351 { get; set; } + public global::Together.GPUClusterCreateRequestGpuType? Type351 { get; set; } /// /// /// - public global::Together.TrainingMethodSFT? Type352 { get; set; } + public global::Together.GPUClustersSharedVolumeCreateRequest? Type352 { get; set; } /// /// /// - public global::Together.TrainingMethodDPO? Type353 { get; set; } + public global::Together.GPUClusterCreateRequestBillingType? Type353 { get; set; } /// /// /// - public global::Together.OneOf? Type354 { get; set; } + public global::Together.OIDCConfig? Type354 { get; set; } /// /// /// - public global::Together.FullTrainingType? Type355 { get; set; } + public global::Together.AcceptanceTestsParams? Type355 { get; set; } /// /// /// - public global::Together.LoRATrainingType? Type356 { get; set; } + public global::Together.InstanceClusterConfig? Type356 { get; set; } /// /// /// - public global::Together.MultimodalParams? Type357 { get; set; } + public global::System.Collections.Generic.IList? Type357 { get; set; } /// /// /// - public global::Together.FinetuneJobStatus? Type358 { get; set; } + public global::Together.AddOnCreateRequest? Type358 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type359 { get; set; } + public global::Together.GPUClusterGPUWorkerNode? Type359 { get; set; } /// /// /// - public global::Together.FineTuneEvent? Type360 { get; set; } + public global::Together.Remediation? Type360 { get; set; } /// /// /// - public global::Together.FineTuneProgress? Type361 { get; set; } + public global::Together.GPUClusterInfo? Type361 { get; set; } /// /// /// - public global::Together.FinetuneResponseTruncated? Type362 { get; set; } + public global::Together.GPUClusterInfoClusterType? Type362 { get; set; } /// /// /// - public global::Together.FinetuneDeleteResponse? Type363 { get; set; } + public global::Together.GPUClusterInfoGpuType? Type363 { get; set; } /// /// /// - public global::Together.FineTuneModelLimits? Type364 { get; set; } + public global::System.Collections.Generic.IList? Type364 { get; set; } /// /// /// - public global::Together.FineTuneModelLimitsFullTraining? Type365 { get; set; } + public global::Together.GPUClusterVolume? Type365 { get; set; } /// /// /// - public global::Together.FineTuneModelLimitsLoraTraining? Type366 { get; set; } + public global::Together.GPUClusterInfoStatus? Type366 { get; set; } /// /// /// - public global::Together.FinetuneEventLevels? Type367 { get; set; } + public global::System.Collections.Generic.IList? Type367 { get; set; } /// /// /// - public global::Together.FinetuneEventType? Type368 { get; set; } + public global::System.Collections.Generic.IList? Type368 { get; set; } /// /// /// - public global::Together.FinetuneTruncatedList? Type369 { get; set; } + public global::System.Collections.Generic.IList? Type369 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type370 { get; set; } + public global::Together.ClusterPhaseTransition? Type370 { get; set; } /// /// /// - public global::Together.FinetuneListEvents? Type371 { get; set; } + public global::Together.GPUClusterInfoBillingType? Type371 { get; set; } /// /// /// - public global::Together.FinetuneListCheckpoints? Type372 { get; set; } + public global::System.Collections.Generic.IList? Type372 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type373 { get; set; } + public global::Together.AddOnInfo? Type373 { get; set; } /// /// /// - public global::Together.FineTuneCheckpoint? Type374 { get; set; } + public global::System.Collections.Generic.IList? Type374 { get; set; } /// /// /// - public global::Together.FullTrainingTypeType? Type375 { get; set; } + public global::Together.GPUClusterNodeLifecycleEvent? Type375 { get; set; } /// /// /// - public global::Together.LoRATrainingTypeType? Type376 { get; set; } + public global::Together.GPUClusterUpdateRequest? Type376 { get; set; } /// /// /// - public global::Together.TrainingMethodSFTMethod? Type377 { get; set; } + public global::Together.GPUClusterUpdateRequestClusterType? Type377 { get; set; } /// /// /// - public global::Together.OneOf? Type378 { get; set; } + public global::System.Collections.Generic.IList? Type378 { get; set; } /// /// /// - public global::Together.TrainingMethodSFTTrainOnInputs? Type379 { get; set; } + public global::Together.AddOnUpdateRequest? Type379 { get; set; } /// /// /// - public global::Together.TrainingMethodDPOMethod? Type380 { get; set; } + public global::Together.GPUClusters? Type380 { get; set; } /// /// /// - public global::Together.LRSchedulerLrSchedulerType? Type381 { get; set; } + public global::System.Collections.Generic.IList? Type381 { get; set; } /// /// /// - public global::Together.OneOf? Type382 { get; set; } + public global::Together.InstanceTypesResponse? Type382 { get; set; } /// /// /// - public global::Together.LinearLRSchedulerArgs? Type383 { get; set; } + public global::System.Collections.Generic.IList? Type383 { get; set; } /// /// /// - public global::Together.CosineLRSchedulerArgs? Type384 { get; set; } + public global::Together.InstanceTypesResponseType? Type384 { get; set; } /// /// /// - public global::Together.Autoscaling? Type385 { get; set; } + public global::Together.RegionListResponse? Type385 { get; set; } /// /// /// - public global::Together.HardwareSpec? Type386 { get; set; } + public global::System.Collections.Generic.IList? Type386 { get; set; } /// /// /// - public global::Together.EndpointPricing? Type387 { get; set; } + public global::Together.RegionListResponseRegion? Type387 { get; set; } /// /// /// - public global::Together.HardwareAvailability? Type388 { get; set; } + public global::System.Collections.Generic.IList? Type388 { get; set; } /// /// /// - public global::Together.HardwareAvailabilityStatus? Type389 { get; set; } + public global::Together.ClusterDriverVersionInfo? Type389 { get; set; } /// /// /// - public global::Together.HardwareWithStatus? Type390 { get; set; } + public global::Together.AcceptanceTestsParamsDcgmDiagLevel? Type390 { get; set; } /// /// /// - public global::Together.CreateEndpointRequest? Type391 { get; set; } + public global::Together.AddOnConfig? Type391 { get; set; } /// /// /// - public global::Together.CreateEndpointRequestState? Type392 { get; set; } + public global::Together.DashboardConfig? Type392 { get; set; } /// /// /// - public global::Together.DedicatedEndpoint? Type393 { get; set; } + public global::Together.IngressConfig? Type393 { get; set; } /// /// /// - public global::Together.DedicatedEndpointType? Type394 { get; set; } + public global::Together.TorchpassConfig? Type394 { get; set; } /// /// /// - public global::Together.DedicatedEndpointState? Type395 { get; set; } + public global::Together.SlurmWebConfig? Type395 { get; set; } /// /// /// - public global::Together.ListEndpoint? Type396 { get; set; } + public global::Together.HeadlampConfig? Type396 { get; set; } /// /// /// - public global::Together.ListEndpointType? Type397 { get; set; } + public global::Together.AddOnState? Type397 { get; set; } /// /// /// - public global::Together.ListEndpointState? Type398 { get; set; } + public global::Together.DashboardState? Type398 { get; set; } /// /// /// - public global::Together.DisplayorExecuteOutput? Type399 { get; set; } + public global::Together.IngressState? Type399 { get; set; } /// /// /// - public global::Together.DisplayorExecuteOutputData? Type400 { get; set; } + public global::Together.TorchpassState? Type400 { get; set; } /// /// /// - public global::Together.DisplayorExecuteOutputType? Type401 { get; set; } + public global::Together.SlurmWebState? Type401 { get; set; } /// /// /// - public global::Together.Error? Type402 { get; set; } + public global::Together.HeadlampState? Type402 { get; set; } /// /// /// - public global::Together.ErrorOutput? Type403 { get; set; } + public global::Together.CommentBody? Type403 { get; set; } /// /// /// - public global::Together.ErrorOutputType? Type404 { get; set; } + public global::Together.ApproveRemediationRequest? Type404 { get; set; } /// /// /// - public global::Together.ExecuteRequest? Type405 { get; set; } + public global::Together.ApproveRemediationRequestMode? Type405 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type406 { get; set; } + public global::Together.ClusterAddOnCreateRequest? Type406 { get; set; } /// /// /// - public global::Together.ExecuteRequestFile? Type407 { get; set; } + public global::Together.ClusterAddOnDeleteResponse? Type407 { get; set; } /// /// /// - public global::Together.ExecuteRequestFileEncoding? Type408 { get; set; } + public global::Together.ClusterAddOnUpdateRequest? Type408 { get; set; } /// /// /// - public global::Together.ExecuteRequestLanguage? Type409 { get; set; } + public global::Together.ClusterAddOnsListResponse? Type409 { get; set; } /// /// /// - public global::Together.ExecuteResponse? Type410 { get; set; } + public global::Together.ClusterIngressConfig? Type410 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecution? Type411 { get; set; } + public global::Together.ClusterPhaseTransitionPhase? Type411 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionData? Type412 { get; set; } + public global::Together.GPUClusterDeleteResponse? Type412 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type413 { get; set; } + public global::Together.InstanceClusterConfigLoadBalancer? Type413 { get; set; } /// /// /// - public global::Together.OutputsItem? Type414 { get; set; } + public global::Together.SlurmStartupScripts? Type414 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? Type415 { get; set; } + public global::Together.ObservabilityConfig? Type415 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? Type416 { get; set; } + public global::Together.ListRemediationsResponse? Type416 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? Type417 { get; set; } + public global::System.Collections.Generic.IList? Type417 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? Type418 { get; set; } + public global::Together.NodePhaseTransitionPhase? Type418 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? Type419 { get; set; } + public global::Together.ListPassiveHealthCheckAlertsResponse? Type419 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? Type420 { get; set; } + public global::System.Collections.Generic.IList? Type420 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? Type421 { get; set; } + public global::Together.PassiveHealthCheckAlert? Type421 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? Type422 { get; set; } + public global::Together.PassiveHealthCheckAlertSeverity? Type422 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? Type423 { get; set; } + public global::Together.RemediationMode? Type423 { get; set; } /// /// /// - public global::Together.ExecuteResponseSuccessfulExecutionDataStatus? Type424 { get; set; } + public global::Together.RemediationTrigger? Type424 { get; set; } /// /// /// - public global::Together.ExecuteResponseFailedExecution? Type425 { get; set; } + public global::Together.RemediationState? Type425 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type426 { get; set; } + public global::Together.GPUClustersSharedVolumeDeleteResponse? Type426 { get; set; } /// /// /// - public global::Together.OneOf? Type427 { get; set; } + public global::Together.GPUClustersSharedVolume? Type427 { get; set; } /// /// /// - public global::Together.InterpreterOutput? Type428 { get; set; } + public global::Together.GPUClustersSharedVolumeStatus? Type428 { get; set; } /// /// /// - public global::Together.InterpreterOutputStreamOutput? Type429 { get; set; } + public global::Together.GPUClustersSharedVolumeUpdateRequest? Type429 { get; set; } /// /// /// - public global::Together.InterpreterOutputStreamOutputType? Type430 { get; set; } + public global::Together.GPUClustersSharedVolumes? Type430 { get; set; } /// /// /// - public global::Together.InterpreterOutputErrorOutput? Type431 { get; set; } + public global::System.Collections.Generic.IList? Type431 { get; set; } /// /// /// - public global::Together.InterpreterOutputErrorOutputType? Type432 { get; set; } + public global::Together.ListVoicesResponse? Type432 { get; set; } /// /// /// - public global::Together.InterpreterOutputDisplayorExecuteOutput? Type433 { get; set; } + public global::System.Collections.Generic.IList? Type433 { get; set; } /// /// /// - public global::Together.InterpreterOutputDisplayorExecuteOutputData? Type434 { get; set; } + public global::Together.ModelVoices? Type434 { get; set; } /// /// /// - public global::Together.InterpreterOutputDisplayorExecuteOutputType? Type435 { get; set; } + public global::System.Collections.Generic.IList? Type435 { get; set; } /// /// /// - public global::Together.InterpreterOutputDiscriminator? Type436 { get; set; } + public global::Together.ModelVoicesVoice? Type436 { get; set; } /// /// /// - public global::Together.InterpreterOutputDiscriminatorType? Type437 { get; set; } + public global::Together.ListAvailibilityZonesResponse? Type437 { get; set; } /// /// /// - public global::Together.Response? Type438 { get; set; } + public global::Together.RerankRequest? Type438 { get; set; } /// /// /// - public global::Together.SessionListResponse? Type439 { get; set; } + public global::Together.AnyOf? Type439 { get; set; } /// /// /// - public global::Together.SessionListResponseResponse? Type440 { get; set; } + public global::Together.RerankRequestModel? Type440 { get; set; } /// /// /// - public global::Together.SessionListResponseVariant2? Type441 { get; set; } + public global::Together.OneOf, global::System.Collections.Generic.IList>? Type441 { get; set; } /// /// /// - public global::Together.SessionListResponseVariant2Data? Type442 { get; set; } + public global::System.Collections.Generic.IList? Type442 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type443 { get; set; } + public global::Together.RerankResponse? Type443 { get; set; } /// /// /// - public global::Together.SessionListResponseVariant2DataSession? Type444 { get; set; } + public global::System.Collections.Generic.IList? Type444 { get; set; } /// /// /// - public global::Together.StreamOutput? Type445 { get; set; } + public global::Together.RerankResponseResult? Type445 { get; set; } /// /// /// - public global::Together.StreamOutputType? Type446 { get; set; } + public global::Together.RerankResponseResultDocument? Type446 { get; set; } /// /// /// - public global::Together.CreateBatchRequest? Type447 { get; set; } + public global::Together.UsageData? Type447 { get; set; } /// /// /// - public global::Together.CreateBatchRequestEndpoint? Type448 { get; set; } + public global::Together.ErrorData? Type448 { get; set; } /// /// /// - public global::Together.BatchErrorResponse? Type449 { get; set; } + public global::Together.ErrorDataError? Type449 { get; set; } /// /// /// - public global::Together.BatchJobWithWarning? Type450 { get; set; } + public global::Together.FinishReason? Type450 { get; set; } /// /// /// - public global::Together.BatchJob? Type451 { get; set; } + public global::Together.LogprobsPart? Type451 { get; set; } /// /// /// - public global::Together.BatchJobStatus? Type452 { get; set; } + public global::System.Collections.Generic.IList? Type452 { get; set; } /// /// /// - public global::Together.EvaluationTypedRequest? Type453 { get; set; } + public global::Together.PromptPartItem? Type453 { get; set; } /// /// /// - public global::Together.EvaluationTypedRequestType? Type454 { get; set; } + public global::Together.InferenceWarning? Type454 { get; set; } /// /// /// - public global::Together.OneOf? Type455 { get; set; } + public global::System.Collections.Generic.IList? Type455 { get; set; } /// /// /// - public global::Together.EvaluationClassifyParameters? Type456 { get; set; } + public global::Together.CompletionChoicesDataItem? Type456 { get; set; } /// /// /// - public global::Together.EvaluationScoreParameters? Type457 { get; set; } + public global::Together.CompletionRequest? Type457 { get; set; } /// /// /// - public global::Together.EvaluationCompareParameters? Type458 { get; set; } + public global::Together.AnyOf? Type458 { get; set; } /// /// /// - public global::Together.EvaluationJudgeModelConfig? Type459 { get; set; } + public global::Together.CompletionRequestModel? Type459 { get; set; } /// /// /// - public global::Together.EvaluationModelOrString? Type460 { get; set; } + public global::Together.AnyOf? Type460 { get; set; } /// /// /// - public global::Together.EvaluationJudgeModelConfigModelSource? Type461 { get; set; } + public global::Together.CompletionRequestSafetyModel? Type461 { get; set; } /// /// /// - public global::Together.EvaluationModelRequest? Type462 { get; set; } + public global::Together.CompletionResponse? Type462 { get; set; } /// /// /// - public global::Together.EvaluationModelRequestModelSource? Type463 { get; set; } + public global::Together.CompletionStream? Type463 { get; set; } /// /// /// - public global::Together.EvaluationResponse? Type464 { get; set; } + public global::Together.CompletionEvent? Type464 { get; set; } /// /// /// - public global::Together.EvaluationResponseStatus? Type465 { get; set; } + public global::Together.StreamSentinel? Type465 { get; set; } /// /// /// - public global::Together.EvaluationJob? Type466 { get; set; } + public global::Together.CompletionChunk? Type466 { get; set; } /// /// /// - public global::Together.EvaluationJobType? Type467 { get; set; } + public global::Together.CompletionToken? Type467 { get; set; } /// /// /// - public global::Together.EvaluationJobStatus? Type468 { get; set; } + public global::System.Collections.Generic.IList? Type468 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type469 { get; set; } + public global::Together.CompletionChoice? Type469 { get; set; } /// /// /// - public global::Together.EvaluationJobStatusUpdate? Type470 { get; set; } + public global::Together.AllOf? Type470 { get; set; } /// /// /// - public global::Together.OneOf? Type471 { get; set; } + public global::Together.AllOf? Type471 { get; set; } /// /// /// - public global::Together.EvaluationClassifyResults? Type472 { get; set; } + public global::Together.CompletionChoiceDelta? Type472 { get; set; } /// /// /// - public global::Together.EvaluationScoreResults? Type473 { get; set; } + public global::Together.CompletionChoiceDeltaRole? Type473 { get; set; } /// /// /// - public global::Together.EvaluationCompareResults? Type474 { get; set; } + public global::System.Collections.Generic.IList? Type474 { get; set; } /// /// /// - public global::Together.EvaluationJobResults? Type475 { get; set; } + public global::Together.ToolChoice2? Type475 { get; set; } /// /// /// - public global::Together.EvaluationScoreResultsAggregatedScores? Type476 { get; set; } + public global::Together.CompletionChoiceDeltaFunctionCall? Type476 { get; set; } /// /// /// - public global::Together.CreateVideoBody? Type477 { get; set; } + public global::System.Collections.Generic.IList? Type477 { get; set; } /// /// /// - public global::Together.VideoOutputFormat? Type478 { get; set; } + public global::Together.ChatCompletionChoicesDataItem? Type478 { get; set; } /// /// /// - public global::Together.VideoMedia? Type479 { get; set; } + public global::Together.ChatCompletionMessage? Type479 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type480 { get; set; } + public global::Together.AllOf? Type480 { get; set; } /// /// /// - public global::Together.VideoFrameImageInput? Type481 { get; set; } + public global::Together.ChatCompletionMessageRole? Type481 { get; set; } /// /// /// - public global::Together.VideoStatus? Type482 { get; set; } + public global::Together.ChatCompletionMessageFunctionCall? Type482 { get; set; } /// /// /// - public global::Together.AnyOf? Type483 { get; set; } + public global::Together.ChatCompletionTool? Type483 { get; set; } /// /// /// - public global::Together.VideoFrameImageInputFrame? Type484 { get; set; } + public global::Together.ChatCompletionToolType? Type484 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type485 { get; set; } + public global::Together.ChatCompletionToolFunction? Type485 { get; set; } /// /// /// - public global::Together.VideoRef? Type486 { get; set; } + public global::Together.ChatCompletionRequest? Type486 { get; set; } /// /// /// - public global::Together.OneOf? Type487 { get; set; } + public global::System.Collections.Generic.IList? Type487 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type488 { get; set; } + public global::Together.ChatCompletionMessageParam? Type488 { get; set; } /// /// /// - public global::Together.OneOf? Type489 { get; set; } + public global::Together.ChatCompletionRequestContextLengthExceededBehavior? Type489 { get; set; } /// /// /// - public global::Together.AudioRef? Type490 { get; set; } + public global::Together.OneOf? Type490 { get; set; } /// /// /// - public global::Together.VideoJob? Type491 { get; set; } + public global::Together.ChatCompletionRequestFunctionCallEnum? Type491 { get; set; } /// /// /// - public global::Together.VideoJobError? Type492 { get; set; } + public global::Together.ChatCompletionRequestFunctionCallEnum2? Type492 { get; set; } /// /// /// - public global::Together.VideoJobOutputs? Type493 { get; set; } + public global::Together.ResponseFormat? Type493 { get; set; } /// /// /// - public global::Together.ContainerStatus? Type494 { get; set; } + public global::Together.ResponseFormatText? Type494 { get; set; } /// /// /// - public global::Together.SignedURLResponse? Type495 { get; set; } + public global::Together.ResponseFormatJsonSchema? Type495 { get; set; } /// /// /// - public global::Together.CreateDeploymentRequest? Type496 { get; set; } + public global::Together.ResponseFormatJsonObject? Type496 { get; set; } /// /// /// - public global::Together.OneOf? Type497 { get; set; } + public global::Together.ChatCompletionRequestResponseFormatDiscriminator? Type497 { get; set; } /// /// /// - public global::Together.HTTPAutoscalingConfig? Type498 { get; set; } + public global::Together.ChatCompletionRequestResponseFormatDiscriminatorType? Type498 { get; set; } /// /// /// - public global::Together.QueueAutoscalingConfig? Type499 { get; set; } + public global::System.Collections.Generic.IList? Type499 { get; set; } /// /// /// - public global::Together.CustomMetricAutoscalingConfig? Type500 { get; set; } + public global::Together.ToolsPart? Type500 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type501 { get; set; } + public global::Together.OneOf? Type501 { get; set; } /// /// /// - public global::Together.EnvironmentVariable? Type502 { get; set; } + public global::Together.ChatCompletionRequestReasoningEffort? Type502 { get; set; } /// /// /// - public global::Together.CreateDeploymentRequestGpuType? Type503 { get; set; } + public global::Together.ChatCompletionRequestReasoning? Type503 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type504 { get; set; } + public global::Together.ResponseFormatTextType? Type504 { get; set; } /// /// /// - public global::Together.VolumeMount? Type505 { get; set; } + public global::Together.ResponseFormatJsonObjectType? Type505 { get; set; } /// /// /// - public global::Together.CreateSecretRequest? Type506 { get; set; } + public global::Together.ResponseFormatJsonSchemaType? Type506 { get; set; } /// /// /// - public global::Together.CreateVolumeRequest? Type507 { get; set; } + public global::Together.ResponseFormatJsonSchemaJsonSchema? Type507 { get; set; } /// /// /// - public global::Together.VolumeContentRequest? Type508 { get; set; } + public global::Together.ResponseFormatJsonSchemaSchema? Type508 { get; set; } /// /// /// - public global::Together.VolumeType? Type509 { get; set; } + public global::Together.ChatCompletionSystemMessageParam? Type509 { get; set; } /// /// /// - public global::Together.DeploymentListResponse? Type510 { get; set; } + public global::Together.ChatCompletionUserMessageParam? Type510 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type511 { get; set; } + public global::Together.ChatCompletionAssistantMessageParam? Type511 { get; set; } /// /// /// - public global::Together.DeploymentResponseItem? Type512 { get; set; } + public global::Together.ChatCompletionToolMessageParam? Type512 { get; set; } /// /// /// - public global::Together.DeploymentLogs? Type513 { get; set; } + public global::Together.ChatCompletionFunctionMessageParam? Type513 { get; set; } /// /// /// - public global::Together.DeploymentResponseItemGpuType? Type514 { get; set; } + public global::Together.ChatCompletionSystemMessageParamRole? Type514 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type515 { get; set; } + public global::Together.ChatCompletionUserMessageContent? Type515 { get; set; } /// /// /// - public global::Together.ReplicaEvent? Type516 { get; set; } + public global::Together.ChatCompletionUserMessageParamRole? Type516 { get; set; } /// /// /// - public global::Together.DeploymentStatus? Type517 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1? Type517 { get; set; } /// /// /// - public global::Together.HTTPAutoscalingConfigMetric? Type518 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type? Type518 { get; set; } /// /// /// - public global::Together.QueueAutoscalingConfigMetric? Type519 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2? Type519 { get; set; } /// /// /// - public global::Together.CustomMetricAutoscalingConfigMetric? Type520 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type? Type520 { get; set; } /// /// /// - public global::Together.KubernetesEvent? Type521 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl? Type521 { get; set; } /// /// /// - public global::Together.ListSecretsResponse? Type522 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideo? Type522 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type523 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType? Type523 { get; set; } /// /// /// - public global::Together.SecretResponseItem? Type524 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl? Type524 { get; set; } /// /// /// - public global::Together.ListVolumesResponse? Type525 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudio? Type525 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type526 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType? Type526 { get; set; } /// /// /// - public global::Together.VolumeResponseItem? Type527 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl? Type527 { get; set; } /// /// /// - public global::Together.UpdateDeploymentRequest? Type528 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio? Type528 { get; set; } /// /// /// - public global::Together.UpdateDeploymentRequestGpuType? Type529 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType? Type529 { get; set; } /// /// /// - public global::Together.UpdateSecretRequest? Type530 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio? Type530 { get; set; } /// /// /// - public global::Together.UpdateVolumeRequest? Type531 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat? Type531 { get; set; } /// /// /// - public global::Together.VolumeContent? Type532 { get; set; } + public global::Together.ChatCompletionAssistantMessageParamRole? Type532 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type533 { get; set; } + public global::Together.ChatCompletionAssistantMessageParamFunctionCall? Type533 { get; set; } /// /// /// - public global::Together.VersionHistoryItem? Type534 { get; set; } + public global::Together.ChatCompletionFunctionMessageParamRole? Type534 { get; set; } /// /// /// - public global::Together.VolumeContentRequestType? Type535 { get; set; } + public global::Together.ChatCompletionToolMessageParamRole? Type535 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type536 { get; set; } + public global::Together.ChatCompletionResponse? Type536 { get; set; } /// /// /// - public global::Together.FileInfo? Type537 { get; set; } + public global::System.Collections.Generic.IList? Type537 { get; set; } /// /// /// - public global::Together.VolumeContentType? Type538 { get; set; } + public global::Together.ChatCompletionStream? Type538 { get; set; } /// /// /// - public global::Together.QueueError? Type539 { get; set; } + public global::Together.ChatCompletionEvent? Type539 { get; set; } /// /// /// - public global::Together.QueueMetricsResponse? Type540 { get; set; } + public global::Together.ChatCompletionChunk? Type540 { get; set; } /// /// /// - public global::Together.QueueCancelRequest? Type541 { get; set; } + public global::System.Collections.Generic.IList? Type541 { get; set; } /// /// /// - public global::Together.QueueCancelResponse? Type542 { get; set; } + public global::Together.ChatCompletionChunkChoice? Type542 { get; set; } /// /// /// - public global::Together.QueueCancelResponseStatus? Type543 { get; set; } + public global::Together.ChatCompletionChunkChoiceDelta? Type543 { get; set; } /// /// /// - public global::Together.QueueJobRequest? Type544 { get; set; } + public global::Together.ChatCompletionChunkChoiceDeltaRole? Type544 { get; set; } /// /// /// - public global::Together.QueueJobResponse? Type545 { get; set; } + public global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? Type545 { get; set; } /// /// /// - public global::Together.QueueJobStatusResponse? Type546 { get; set; } + public global::Together.AudioSpeechRequest? Type546 { get; set; } /// /// /// - public global::Together.QueueJobStatusResponseStatus? Type547 { get; set; } + public global::Together.AnyOf? Type547 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequest? Type548 { get; set; } + public global::Together.AudioSpeechRequestModel? Type548 { get; set; } /// /// /// - public global::Together.AnyOf? Type549 { get; set; } + public global::Together.AudioSpeechRequestResponseFormat? Type549 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestModel? Type550 { get; set; } + public global::Together.AudioSpeechRequestResponseEncoding? Type550 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestResponseFormat? Type551 { get; set; } + public global::Together.AudioSpeechRequestExtraParams? Type551 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestOutputFormat? Type552 { get; set; } + public global::Together.AudioTranscriptionRequest? Type552 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type553 { get; set; } + public global::Together.OneOf? Type553 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestImageLora? Type554 { get; set; } + public byte[]? Type554 { get; set; } /// /// /// - public global::Together.CreateFilesUploadRequest? Type555 { get; set; } + public global::Together.AudioTranscriptionRequestModel? Type555 { get; set; } /// /// /// - public global::Together.CreateFineTunesRequest? Type556 { get; set; } + public global::Together.AudioTranscriptionRequestResponseFormat? Type556 { get; set; } /// /// /// - public global::Together.OneOf? Type557 { get; set; } + public global::Together.OneOf>? Type557 { get; set; } /// /// /// - public global::Together.CreateFineTunesRequestBatchSize? Type558 { get; set; } + public global::Together.AudioTranscriptionRequestTimestampGranularities? Type558 { get; set; } /// /// /// - public global::Together.OneOf? Type559 { get; set; } + public global::System.Collections.Generic.IList? Type559 { get; set; } /// /// /// - public global::Together.CreateFineTunesRequestTrainOnInputs? Type560 { get; set; } + public global::Together.AudioTranscriptionRequestTimestampGranularitie? Type560 { get; set; } /// /// /// - public global::Together.AnyOf? Type561 { get; set; } + public global::Together.AudioTranscriptionResponse? Type561 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceRequest? Type562 { get; set; } + public global::Together.AudioTranscriptionJsonResponse? Type562 { get; set; } /// /// /// - public global::Together.UpdateEndpointRequest? Type563 { get; set; } + public global::Together.AudioTranscriptionVerboseJsonResponse? Type563 { get; set; } /// /// /// - public global::Together.UpdateEndpointRequestState? Type564 { get; set; } + public global::System.Collections.Generic.IList? Type564 { get; set; } /// /// /// - public global::Together.GetFinetuneDownloadCheckpoint? Type565 { get; set; } + public global::Together.AudioTranscriptionSegment? Type565 { get; set; } /// /// /// - public global::Together.RealtimeTtsModel? Type566 { get; set; } + public global::System.Collections.Generic.IList? Type566 { get; set; } /// /// /// - public global::Together.ListEndpointsType? Type567 { get; set; } + public global::Together.AudioTranscriptionWord? Type567 { get; set; } /// /// /// - public global::Together.ListEndpointsUsageType? Type568 { get; set; } + public global::System.Collections.Generic.IList? Type568 { get; set; } /// /// /// - public global::Together.RealtimeTranscriptionInputAudioFormat? Type569 { get; set; } + public global::Together.AudioTranscriptionSpeakerSegment? Type569 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type570 { get; set; } + public global::Together.AudioTranslationRequest? Type570 { get; set; } /// /// /// - public global::Together.RemediationServiceListRemediationsStateItem? Type571 { get; set; } + public global::Together.AudioTranslationRequestModel? Type571 { get; set; } /// /// /// - public global::Together.RemediationServiceListRemediationsMode? Type572 { get; set; } + public global::Together.AudioTranslationRequestResponseFormat? Type572 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type573 { get; set; } + public global::Together.OneOf>? Type573 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceResponse? Type574 { get; set; } + public global::Together.AudioTranslationRequestTimestampGranularities? Type574 { get; set; } /// /// /// - public global::Together.GetFineTunesMetricsResponse? Type575 { get; set; } + public global::System.Collections.Generic.IList? Type575 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type576 { get; set; } + public global::Together.AudioTranslationRequestTimestampGranularitie? Type576 { get; set; } /// /// /// - public global::Together.GetFineTunesModelsSupportedResponse? Type577 { get; set; } + public global::Together.AudioTranslationResponse? Type577 { get; set; } /// /// /// - public global::Together.GetFineTunesModelsLimitsResponse? Type578 { get; set; } + public global::Together.AudioTranslationJsonResponse? Type578 { get; set; } /// /// /// - public global::Together.ListEndpointsResponse? Type579 { get; set; } + public global::Together.AudioTranslationVerboseJsonResponse? Type579 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type580 { get; set; } + public global::Together.AudioSpeechStreamResponse? Type580 { get; set; } /// /// /// - public global::Together.ListHardwareResponse? Type581 { get; set; } + public global::Together.AudioSpeechStreamEvent? Type581 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type582 { get; set; } + public global::Together.AudioSpeechStreamChunk? Type582 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type583 { get; set; } + public global::Together.StreamSentinelData? Type583 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type584 { get; set; } + public global::Together.ChatCompletionToken? Type584 { get; set; } /// /// /// - public global::Together.GetModelListResponse? Type585 { get; set; } + public global::Together.ChatCompletionChoice? Type585 { get; set; } /// /// /// - public global::Together.GetEvaluationJobStatusAndResultsResponse? Type586 { get; set; } + public global::Together.ChatCompletionChoiceDelta? Type586 { get; set; } /// /// /// - public global::Together.GetEvaluationJobStatusAndResultsResponseStatus? Type587 { get; set; } + public global::Together.ChatCompletionChoiceDeltaRole? Type587 { get; set; } /// /// /// - public global::Together.OneOf? Type588 { get; set; } + public global::Together.ChatCompletionChoiceDeltaFunctionCall? Type588 { get; set; } + /// + /// + /// + public global::Together.EmbeddingsRequest? Type589 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type590 { get; set; } + /// + /// + /// + public global::Together.EmbeddingsRequestModel? Type591 { get; set; } + /// + /// + /// + public global::Together.OneOf>? Type592 { get; set; } + /// + /// + /// + public global::Together.EmbeddingsResponse? Type593 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type594 { get; set; } + /// + /// + /// + public global::Together.EmbeddingsResponseDataItem? Type595 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type596 { get; set; } + /// + /// + /// + public global::Together.ModelInfo? Type597 { get; set; } + /// + /// + /// + public global::Together.ModelInfoType? Type598 { get; set; } + /// + /// + /// + public global::Together.Pricing? Type599 { get; set; } + /// + /// + /// + public global::Together.ModelUploadRequest? Type600 { get; set; } + /// + /// + /// + public global::Together.ModelUploadRequestModelType? Type601 { get; set; } + /// + /// + /// + public global::Together.ModelUploadSuccessResponse? Type602 { get; set; } + /// + /// + /// + public global::Together.ModelUploadSuccessResponseData? Type603 { get; set; } + /// + /// + /// + public global::Together.ImageResponse? Type604 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type605 { get; set; } + /// + /// + /// + public global::Together.DataItem3? Type606 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataB64? Type607 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataUrl? Type608 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataItemDiscriminator? Type609 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataItemDiscriminatorType? Type610 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataB64Type? Type611 { get; set; } + /// + /// + /// + public global::Together.ImageResponseDataUrlType? Type612 { get; set; } + /// + /// + /// + public global::Together.JobInfoSuccessResponse? Type613 { get; set; } + /// + /// + /// + public global::Together.JobInfoSuccessResponseStatus? Type614 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type615 { get; set; } + /// + /// + /// + public global::Together.JobInfoSuccessResponseStatusUpdate? Type616 { get; set; } + /// + /// + /// + public global::Together.JobInfoSuccessResponseArgs? Type617 { get; set; } + /// + /// + /// + public global::Together.JobsInfoSuccessResponse? Type618 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type619 { get; set; } + /// + /// + /// + public global::Together.ToolsPartFunction? Type620 { get; set; } + /// + /// + /// + public global::Together.ToolChoiceType? Type621 { get; set; } + /// + /// + /// + public global::Together.ToolChoiceFunction? Type622 { get; set; } + /// + /// + /// + public global::Together.FileResponse? Type623 { get; set; } + /// + /// + /// + public global::Together.FilePurpose? Type624 { get; set; } + /// + /// + /// + public global::Together.FileType? Type625 { get; set; } + /// + /// + /// + public global::Together.FileProcessingStatus? Type626 { get; set; } + /// + /// + /// + public global::Together.FileValidationReport? Type627 { get; set; } + /// + /// + /// + public global::Together.FileValidationReportErrorType? Type628 { get; set; } + /// + /// + /// + public global::Together.FileList? Type629 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type630 { get; set; } + /// + /// + /// + public global::Together.FileDeleteResponse? Type631 { get; set; } + /// + /// + /// + public global::Together.FinetuneResponse? Type632 { get; set; } + /// + /// + /// + public global::System.Guid? Type633 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type634 { get; set; } + /// + /// + /// + public global::Together.FinetuneResponseBatchSize? Type635 { get; set; } + /// + /// + /// + public global::Together.LRScheduler? Type636 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type637 { get; set; } + /// + /// + /// + public global::Together.FinetuneResponseTrainOnInputs? Type638 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type639 { get; set; } + /// + /// + /// + public global::Together.TrainingMethodSFT? Type640 { get; set; } + /// + /// + /// + public global::Together.TrainingMethodDPO? Type641 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type642 { get; set; } + /// + /// + /// + public global::Together.FullTrainingType? Type643 { get; set; } + /// + /// + /// + public global::Together.LoRATrainingType? Type644 { get; set; } + /// + /// + /// + public global::Together.MultimodalParams? Type645 { get; set; } + /// + /// + /// + public global::Together.FinetuneJobStatus? Type646 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type647 { get; set; } + /// + /// + /// + public global::Together.FineTuneEvent? Type648 { get; set; } + /// + /// + /// + public global::Together.FineTuneProgress? Type649 { get; set; } + /// + /// + /// + public global::Together.FinetuneResponseTruncated? Type650 { get; set; } + /// + /// + /// + public global::Together.FinetuneDeleteResponse? Type651 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewRequest? Type652 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewRequestTrainingMethod? Type653 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewResponse? Type654 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewResponseDatasetFormat? Type655 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type656 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewRow? Type657 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type658 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type659 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewMessageError? Type660 { get; set; } + /// + /// + /// + public global::Together.FineTunePreviewDetailError? Type661 { get; set; } + /// + /// + /// + public global::Together.FineTuneModelLimits? Type662 { get; set; } + /// + /// + /// + public global::Together.FineTuneModelLimitsFullTraining? Type663 { get; set; } + /// + /// + /// + public global::Together.FineTuneModelLimitsLoraTraining? Type664 { get; set; } + /// + /// + /// + public global::Together.FinetuneEventLevels? Type665 { get; set; } + /// + /// + /// + public global::Together.FinetuneEventType? Type666 { get; set; } + /// + /// + /// + public global::Together.FinetuneTruncatedList? Type667 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type668 { get; set; } + /// + /// + /// + public global::Together.FinetuneListEvents? Type669 { get; set; } + /// + /// + /// + public global::Together.FinetuneListCheckpoints? Type670 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type671 { get; set; } + /// + /// + /// + public global::Together.FineTuneCheckpoint? Type672 { get; set; } + /// + /// + /// + public global::Together.FineTuneCheckpointCheckpoint? Type673 { get; set; } + /// + /// + /// + public global::Together.FullTrainingTypeType? Type674 { get; set; } + /// + /// + /// + public global::Together.LoRATrainingTypeType? Type675 { get; set; } + /// + /// + /// + public global::Together.TrainingMethodSFTMethod? Type676 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type677 { get; set; } + /// + /// + /// + public global::Together.TrainingMethodSFTTrainOnInputs? Type678 { get; set; } + /// + /// + /// + public global::Together.TrainingMethodDPOMethod? Type679 { get; set; } + /// + /// + /// + public global::Together.LRSchedulerLrSchedulerType? Type680 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type681 { get; set; } + /// + /// + /// + public global::Together.LinearLRSchedulerArgs? Type682 { get; set; } + /// + /// + /// + public global::Together.CosineLRSchedulerArgs? Type683 { get; set; } + /// + /// + /// + public global::Together.Autoscaling? Type684 { get; set; } + /// + /// + /// + public global::Together.HardwareSpec? Type685 { get; set; } + /// + /// + /// + public global::Together.EndpointPricing? Type686 { get; set; } + /// + /// + /// + public global::Together.HardwareAvailability? Type687 { get; set; } + /// + /// + /// + public global::Together.HardwareAvailabilityStatus? Type688 { get; set; } + /// + /// + /// + public global::Together.HardwareWithStatus? Type689 { get; set; } + /// + /// + /// + public global::Together.CreateEndpointRequest? Type690 { get; set; } + /// + /// + /// + public global::Together.CreateEndpointRequestState? Type691 { get; set; } + /// + /// + /// + public global::Together.DedicatedEndpoint? Type692 { get; set; } + /// + /// + /// + public global::Together.DedicatedEndpointType? Type693 { get; set; } + /// + /// + /// + public global::Together.DedicatedEndpointState? Type694 { get; set; } + /// + /// + /// + public global::Together.ListEndpoint? Type695 { get; set; } + /// + /// + /// + public global::Together.ListEndpointType? Type696 { get; set; } + /// + /// + /// + public global::Together.ListEndpointState? Type697 { get; set; } + /// + /// + /// + public global::Together.DisplayorExecuteOutput? Type698 { get; set; } + /// + /// + /// + public global::Together.DisplayorExecuteOutputData? Type699 { get; set; } + /// + /// + /// + public global::Together.DisplayorExecuteOutputType? Type700 { get; set; } + /// + /// + /// + public global::Together.Error? Type701 { get; set; } + /// + /// + /// + public global::Together.ErrorOutput? Type702 { get; set; } + /// + /// + /// + public global::Together.ErrorOutputType? Type703 { get; set; } + /// + /// + /// + public global::Together.ExecuteRequest? Type704 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type705 { get; set; } + /// + /// + /// + public global::Together.ExecuteRequestFile? Type706 { get; set; } + /// + /// + /// + public global::Together.ExecuteRequestFileEncoding? Type707 { get; set; } + /// + /// + /// + public global::Together.ExecuteRequestLanguage? Type708 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponse? Type709 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecution? Type710 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionData? Type711 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type712 { get; set; } + /// + /// + /// + public global::Together.OutputsItem? Type713 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? Type714 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? Type715 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? Type716 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? Type717 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? Type718 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? Type719 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? Type720 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? Type721 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? Type722 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataStatus? Type723 { get; set; } + /// + /// + /// + public global::Together.ExecuteResponseFailedExecution? Type724 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type725 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type726 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutput? Type727 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputStreamOutput? Type728 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputStreamOutputType? Type729 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputErrorOutput? Type730 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputErrorOutputType? Type731 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputDisplayorExecuteOutput? Type732 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputDisplayorExecuteOutputData? Type733 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputDisplayorExecuteOutputType? Type734 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputDiscriminator? Type735 { get; set; } + /// + /// + /// + public global::Together.InterpreterOutputDiscriminatorType? Type736 { get; set; } + /// + /// + /// + public global::Together.Response? Type737 { get; set; } + /// + /// + /// + public global::Together.SessionListResponse? Type738 { get; set; } + /// + /// + /// + public global::Together.SessionListResponseResponse? Type739 { get; set; } + /// + /// + /// + public global::Together.SessionListResponseVariant2? Type740 { get; set; } + /// + /// + /// + public global::Together.SessionListResponseVariant2Data? Type741 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type742 { get; set; } + /// + /// + /// + public global::Together.SessionListResponseVariant2DataSession? Type743 { get; set; } + /// + /// + /// + public global::Together.StreamOutput? Type744 { get; set; } + /// + /// + /// + public global::Together.StreamOutputType? Type745 { get; set; } + /// + /// + /// + public global::Together.CreateBatchRequest? Type746 { get; set; } + /// + /// + /// + public global::Together.CreateBatchRequestEndpoint? Type747 { get; set; } + /// + /// + /// + public global::Together.BatchErrorResponse? Type748 { get; set; } + /// + /// + /// + public global::Together.BatchJobWithWarning? Type749 { get; set; } + /// + /// + /// + public global::Together.BatchJob? Type750 { get; set; } + /// + /// + /// + public global::Together.BatchJobStatus? Type751 { get; set; } + /// + /// + /// + public global::Together.EvaluationTypedRequest? Type752 { get; set; } + /// + /// + /// + public global::Together.EvaluationTypedRequestType? Type753 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type754 { get; set; } + /// + /// + /// + public global::Together.EvaluationClassifyParameters? Type755 { get; set; } + /// + /// + /// + public global::Together.EvaluationScoreParameters? Type756 { get; set; } + /// + /// + /// + public global::Together.EvaluationCompareParameters? Type757 { get; set; } + /// + /// + /// + public global::Together.EvaluationJudgeModelConfig? Type758 { get; set; } + /// + /// + /// + public global::Together.EvaluationModelOrString? Type759 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type760 { get; set; } + /// + /// + /// + public global::Together.EvaluationModelRequest? Type761 { get; set; } + /// + /// + /// + public global::Together.EvaluationJudgeModelConfigModelSource? Type762 { get; set; } + /// + /// + /// + public global::Together.EvaluationModelRequestModelSource? Type763 { get; set; } + /// + /// + /// + public global::Together.EvaluationResponse? Type764 { get; set; } + /// + /// + /// + public global::Together.EvaluationResponseStatus? Type765 { get; set; } + /// + /// + /// + public global::Together.EvaluationJob? Type766 { get; set; } + /// + /// + /// + public global::Together.EvaluationJobType? Type767 { get; set; } + /// + /// + /// + public global::Together.EvaluationJobStatus? Type768 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type769 { get; set; } + /// + /// + /// + public global::Together.EvaluationJobStatusUpdate? Type770 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type771 { get; set; } + /// + /// + /// + public global::Together.EvaluationClassifyResults? Type772 { get; set; } + /// + /// + /// + public global::Together.EvaluationScoreResults? Type773 { get; set; } + /// + /// + /// + public global::Together.EvaluationCompareResults? Type774 { get; set; } + /// + /// + /// + public global::Together.EvaluationJobResults? Type775 { get; set; } + /// + /// + /// + public global::Together.EvaluationScoreResultsAggregatedScores? Type776 { get; set; } + /// + /// + /// + public global::Together.CreateVideoBody? Type777 { get; set; } + /// + /// + /// + public global::Together.VideoOutputFormat? Type778 { get; set; } + /// + /// + /// + public global::Together.VideoMedia? Type779 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type780 { get; set; } + /// + /// + /// + public global::Together.VideoFrameImageInput? Type781 { get; set; } + /// + /// + /// + public global::Together.VideoStatus? Type782 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type783 { get; set; } + /// + /// + /// + public global::Together.VideoFrameImageInputFrame? Type784 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type785 { get; set; } + /// + /// + /// + public global::Together.VideoRef? Type786 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type787 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type788 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type789 { get; set; } + /// + /// + /// + public global::Together.AudioRef? Type790 { get; set; } + /// + /// + /// + public global::Together.VideoJob? Type791 { get; set; } + /// + /// + /// + public global::Together.VideoJobError? Type792 { get; set; } + /// + /// + /// + public global::Together.VideoJobOutputs? Type793 { get; set; } + /// + /// + /// + public global::Together.ContainerStatus? Type794 { get; set; } + /// + /// + /// + public global::Together.SignedURLResponse? Type795 { get; set; } + /// + /// + /// + public global::Together.CreateDeploymentRequest? Type796 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type797 { get; set; } + /// + /// + /// + public global::Together.HTTPAutoscalingConfig? Type798 { get; set; } + /// + /// + /// + public global::Together.QueueAutoscalingConfig? Type799 { get; set; } + /// + /// + /// + public global::Together.CustomMetricAutoscalingConfig? Type800 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type801 { get; set; } + /// + /// + /// + public global::Together.EnvironmentVariable? Type802 { get; set; } + /// + /// + /// + public global::Together.CreateDeploymentRequestGpuType? Type803 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type804 { get; set; } + /// + /// + /// + public global::Together.VolumeMount? Type805 { get; set; } + /// + /// + /// + public global::Together.CreateSecretRequest? Type806 { get; set; } + /// + /// + /// + public global::Together.CreateVolumeRequest? Type807 { get; set; } + /// + /// + /// + public global::Together.VolumeContentRequest? Type808 { get; set; } + /// + /// + /// + public global::Together.VolumeType? Type809 { get; set; } + /// + /// + /// + public global::Together.DeploymentListResponse? Type810 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type811 { get; set; } + /// + /// + /// + public global::Together.DeploymentResponseItem? Type812 { get; set; } + /// + /// + /// + public global::Together.DeploymentLogs? Type813 { get; set; } + /// + /// + /// + public global::Together.DeploymentResponseItemGpuType? Type814 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type815 { get; set; } + /// + /// + /// + public global::Together.ReplicaEvent? Type816 { get; set; } + /// + /// + /// + public global::Together.DeploymentStatus? Type817 { get; set; } + /// + /// + /// + public global::Together.HTTPAutoscalingConfigMetric? Type818 { get; set; } + /// + /// + /// + public global::Together.QueueAutoscalingConfigMetric? Type819 { get; set; } + /// + /// + /// + public global::Together.CustomMetricAutoscalingConfigMetric? Type820 { get; set; } + /// + /// + /// + public global::Together.KubernetesEvent? Type821 { get; set; } + /// + /// + /// + public global::Together.ListSecretsResponse? Type822 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type823 { get; set; } + /// + /// + /// + public global::Together.SecretResponseItem? Type824 { get; set; } + /// + /// + /// + public global::Together.ListVolumesResponse? Type825 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type826 { get; set; } + /// + /// + /// + public global::Together.VolumeResponseItem? Type827 { get; set; } + /// + /// + /// + public global::Together.UpdateDeploymentRequest? Type828 { get; set; } + /// + /// + /// + public global::Together.UpdateDeploymentRequestGpuType? Type829 { get; set; } + /// + /// + /// + public global::Together.UpdateSecretRequest? Type830 { get; set; } + /// + /// + /// + public global::Together.UpdateVolumeRequest? Type831 { get; set; } + /// + /// + /// + public global::Together.VolumeContent? Type832 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type833 { get; set; } + /// + /// + /// + public global::Together.VersionHistoryItem? Type834 { get; set; } + /// + /// + /// + public global::Together.VolumeContentRequestType? Type835 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type836 { get; set; } + /// + /// + /// + public global::Together.FileInfo? Type837 { get; set; } + /// + /// + /// + public global::Together.VolumeContentType? Type838 { get; set; } + /// + /// + /// + public global::Together.QueueError? Type839 { get; set; } + /// + /// + /// + public global::Together.QueueMetricsResponse? Type840 { get; set; } + /// + /// + /// + public global::Together.QueueCancelRequest? Type841 { get; set; } + /// + /// + /// + public global::Together.QueueCancelResponse? Type842 { get; set; } + /// + /// + /// + public global::Together.QueueCancelResponseStatus? Type843 { get; set; } + /// + /// + /// + public global::Together.QueueClearRequest? Type844 { get; set; } + /// + /// + /// + public global::Together.QueueClearResponse? Type845 { get; set; } + /// + /// + /// + public global::Together.QueueJobRequest? Type846 { get; set; } + /// + /// + /// + public global::Together.QueueJobResponse? Type847 { get; set; } + /// + /// + /// + public global::Together.QueueJobStatusResponse? Type848 { get; set; } + /// + /// + /// + public global::Together.QueueJobStatusResponseStatus? Type849 { get; set; } + /// + /// + /// + public global::Together.WhoamiResponse? Type850 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequest? Type851 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type852 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestModel? Type853 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestResponseFormat? Type854 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestOutputFormat? Type855 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type856 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestImageLora? Type857 { get; set; } + /// + /// + /// + public global::Together.CreateFilesUploadRequest? Type858 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequest? Type859 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type860 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequestBatchSize? Type861 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type862 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequestTrainOnInputs? Type863 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type864 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceRequest? Type865 { get; set; } + /// + /// + /// + public global::Together.UpdateEndpointRequest? Type866 { get; set; } + /// + /// + /// + public global::Together.UpdateEndpointRequestState? Type867 { get; set; } + /// + /// + /// + public global::Together.AddAdapterRequest? Type868 { get; set; } + /// + /// + /// + public global::Together.RemoveAdapterRequest? Type869 { get; set; } + /// + /// + /// + public global::Together.RolloutServiceListRolloutsFilter? Type870 { get; set; } + /// + /// + /// + public global::Together.EndpointServiceListEndpointEventsMinLevel? Type871 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type872 { get; set; } + /// + /// + /// + public global::Together.EndpointServiceListEndpointEventsSourceKind? Type873 { get; set; } + /// + /// + /// + public global::Together.VolumeServiceListModelsVisibility? Type874 { get; set; } + /// + /// + /// + public global::Together.SupportedModelsServiceListSupportedModelsModality? Type875 { get; set; } + /// + /// + /// + public global::Together.SupportedModelsServiceListSupportedModelsProduct? Type876 { get; set; } + /// + /// + /// + public global::Together.GetFinetuneDownloadCheckpoint? Type877 { get; set; } + /// + /// + /// + public global::Together.RealtimeTtsModel? Type878 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsType? Type879 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsUsageType? Type880 { get; set; } + /// + /// + /// + public global::Together.RealtimeTranscriptionInputAudioFormat? Type881 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type882 { get; set; } + /// + /// + /// + public global::Together.ListModelResourcesStatu? Type883 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type884 { get; set; } + /// + /// + /// + public global::Together.ListTrainingSessionsStatu? Type885 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type886 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsStateItem? Type887 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type888 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsTriggerItem? Type889 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type890 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsModeItem? Type891 { get; set; } + /// + /// + /// + public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? Type892 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type893 { get; set; } + /// + /// + /// + public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? Type894 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type895 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant1? Type896 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant2? Type897 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? Type898 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type899 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesMetricsResponse? Type900 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type901 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsSupportedResponse? Type902 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type903 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsSupportedResponseDetailedModel? Type904 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsLimitsResponse? Type905 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsResponse? Type906 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type907 { get; set; } + /// + /// + /// + public global::Together.AddAdapterResponse? Type908 { get; set; } + /// + /// + /// + public global::Together.ListAdaptersResponse? Type909 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type910 { get; set; } + /// + /// + /// + public global::Together.ListAdaptersResponseDataItem? Type911 { get; set; } + /// + /// + /// + public global::Together.RemoveAdapterResponse? Type912 { get; set; } + /// + /// + /// + public global::Together.ListHardwareResponse? Type913 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type914 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type915 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type916 { get; set; } + /// + /// + /// + public global::Together.GetModelListResponse? Type917 { get; set; } + /// + /// + /// + public global::Together.GetEvaluationJobStatusAndResultsResponse? Type918 { get; set; } + /// + /// + /// + public global::Together.GetEvaluationJobStatusAndResultsResponseStatus? Type919 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type920 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType0 { get; set; } + public global::System.Collections.Generic.List? ListType0 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType1 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType2 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType3 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType4 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType5 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType6 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType7 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType8 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType9 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType10 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType11 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType12 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType13 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType14 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType15 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType16 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType17 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType18 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType19 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType20 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType21 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType22 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType23 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType24 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType25 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType26 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType27 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType28 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType29 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType30 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType31 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType32 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType33 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType34 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType35 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType36 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType37 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType38 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType39 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType40 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType41 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType42 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType43 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType44 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType45 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType46 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType47 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType48 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List>? ListType49 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType50 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType51 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType52 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType53 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType54 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType55 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType56 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType57 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType58 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType59 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType60 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType61 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::System.Collections.Generic.List? ListType62 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType2 { get; set; } + public global::System.Collections.Generic.List? ListType63 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType3 { get; set; } + public global::System.Collections.Generic.List? ListType64 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType65 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType66 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType67 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType68 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType69 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType70 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType71 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType72 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType73 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType74 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType75 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType76 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType77 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType78 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::Together.OneOf, global::System.Collections.Generic.List>? ListType79 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType80 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType81 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType82 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType83 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType84 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType85 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType86 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType87 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType88 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType89 { get; set; } /// /// /// - public global::Together.OneOf, global::System.Collections.Generic.List>? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType90 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::Together.OneOf>? ListType91 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType92 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType93 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType94 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType95 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::Together.OneOf>? ListType96 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType97 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::Together.OneOf>? ListType98 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType99 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType100 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType101 { get; set; } /// /// /// - public global::Together.OneOf>? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType102 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType103 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType43 { get; set; } + public global::System.Collections.Generic.List? ListType104 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType44 { get; set; } + public global::System.Collections.Generic.List? ListType105 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType45 { get; set; } + public global::System.Collections.Generic.List? ListType106 { get; set; } /// /// /// - public global::Together.OneOf>? ListType46 { get; set; } + public global::System.Collections.Generic.List? ListType107 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType47 { get; set; } + public global::System.Collections.Generic.List>? ListType108 { get; set; } /// /// /// - public global::Together.OneOf>? ListType48 { get; set; } + public global::System.Collections.Generic.List? ListType109 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType49 { get; set; } + public global::System.Collections.Generic.List? ListType110 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType50 { get; set; } + public global::System.Collections.Generic.List? ListType111 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType51 { get; set; } + public global::System.Collections.Generic.List? ListType112 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType52 { get; set; } + public global::System.Collections.Generic.List>? ListType113 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType53 { get; set; } + public global::System.Collections.Generic.List? ListType114 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType54 { get; set; } + public global::System.Collections.Generic.List? ListType115 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType55 { get; set; } + public global::System.Collections.Generic.List? ListType116 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType56 { get; set; } + public global::System.Collections.Generic.List? ListType117 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType57 { get; set; } + public global::System.Collections.Generic.List>? ListType118 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType58 { get; set; } + public global::System.Collections.Generic.List? ListType119 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType59 { get; set; } + public global::System.Collections.Generic.List? ListType120 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType60 { get; set; } + public global::System.Collections.Generic.List? ListType121 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType61 { get; set; } + public global::System.Collections.Generic.List? ListType122 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType62 { get; set; } + public global::System.Collections.Generic.List? ListType123 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType63 { get; set; } + public global::System.Collections.Generic.List? ListType124 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType64 { get; set; } + public global::System.Collections.Generic.List? ListType125 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType65 { get; set; } + public global::System.Collections.Generic.List? ListType126 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType66 { get; set; } + public global::System.Collections.Generic.List? ListType127 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType67 { get; set; } + public global::System.Collections.Generic.List? ListType128 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType68 { get; set; } + public global::System.Collections.Generic.List? ListType129 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType69 { get; set; } + public global::System.Collections.Generic.List? ListType130 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType70 { get; set; } + public global::System.Collections.Generic.List? ListType131 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType71 { get; set; } + public global::System.Collections.Generic.List? ListType132 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType72 { get; set; } + public global::System.Collections.Generic.List>? ListType133 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType73 { get; set; } + public global::System.Collections.Generic.List? ListType134 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType74 { get; set; } + public global::System.Collections.Generic.List? ListType135 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType75 { get; set; } + public global::System.Collections.Generic.List? ListType136 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType76 { get; set; } + public global::System.Collections.Generic.List? ListType137 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType77 { get; set; } + public global::System.Collections.Generic.List? ListType138 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType78 { get; set; } + public global::System.Collections.Generic.List? ListType139 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.Json.g.cs index 8e6266d8..76d0cffb 100644 --- a/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AcceptanceTestsParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AcceptanceTestsParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AcceptanceTestsParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.g.cs b/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.g.cs index c4f487cd..da6b9a83 100644 --- a/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.g.cs +++ b/src/libs/Together/Generated/Together.Models.AcceptanceTestsParams.g.cs @@ -51,6 +51,12 @@ public sealed partial class AcceptanceTestsParams [global::System.Text.Json.Serialization.JsonPropertyName("nccl_multi_node_skipped")] public bool? NcclMultiNodeSkipped { get; set; } + /// + /// Skip storage-performance acceptance test. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("storage_skipped")] + public bool? StorageSkipped { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -81,6 +87,9 @@ public sealed partial class AcceptanceTestsParams /// /// Skip NCCL multi-node acceptance test. /// + /// + /// Skip storage-performance acceptance test. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -91,7 +100,8 @@ public AcceptanceTestsParams( bool? ncclSingleNodeSkipped, bool? gpuBurnSkipped, bool? dcgmDiagSkipped, - bool? ncclMultiNodeSkipped) + bool? ncclMultiNodeSkipped, + bool? storageSkipped) { this.Enabled = enabled; this.DcgmDiagLevel = dcgmDiagLevel; @@ -100,6 +110,7 @@ public AcceptanceTestsParams( this.GpuBurnSkipped = gpuBurnSkipped; this.DcgmDiagSkipped = dcgmDiagSkipped; this.NcclMultiNodeSkipped = ncclMultiNodeSkipped; + this.StorageSkipped = storageSkipped; } /// diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs new file mode 100644 index 00000000..4566c4dd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class AddAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.AddAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.AddAdapterRequest), + jsonSerializerContext) as global::Together.AddAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.AddAdapterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.AddAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddAdapterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs new file mode 100644 index 00000000..968ced33 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs @@ -0,0 +1,50 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class AddAdapterRequest + { + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + ///
+ /// username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AddAdapterRequest( + string modelId) + { + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + } + + /// + /// Initializes a new instance of the class. + /// + public AddAdapterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs new file mode 100644 index 00000000..c98e9ff3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class AddAdapterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.AddAdapterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.AddAdapterResponse), + jsonSerializerContext) as global::Together.AddAdapterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddAdapterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.AddAdapterResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.AddAdapterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddAdapterResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs new file mode 100644 index 00000000..a0c274fb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class AddAdapterResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AddAdapterResponse( + string? modelId) + { + this.ModelId = modelId; + } + + /// + /// Initializes a new instance of the class. + /// + public AddAdapterResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.AddOnConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddOnConfig.Json.g.cs index aa48e6da..7e7e785c 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AddOnConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddOnConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddOnConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AddOnConfig.g.cs b/src/libs/Together/Generated/Together.Models.AddOnConfig.g.cs index 386d9108..613de319 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnConfig.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Configuration for a cluster add-on. /// public sealed partial class AddOnConfig { @@ -20,6 +20,24 @@ public sealed partial class AddOnConfig [global::System.Text.Json.Serialization.JsonPropertyName("ingress")] public global::Together.IngressConfig? Ingress { get; set; } + /// + /// Configuration for the Model Aware TorchPass add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("torchpass")] + public global::Together.TorchpassConfig? Torchpass { get; set; } + + /// + /// Configuration for the Slurm Web add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slurm_web")] + public global::Together.SlurmWebConfig? SlurmWeb { get; set; } + + /// + /// Configuration for the Headlamp Kubernetes dashboard add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("headlamp")] + public global::Together.HeadlampConfig? Headlamp { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -31,15 +49,30 @@ public sealed partial class AddOnConfig ///
/// /// + /// + /// Configuration for the Model Aware TorchPass add-on. + /// + /// + /// Configuration for the Slurm Web add-on. + /// + /// + /// Configuration for the Headlamp Kubernetes dashboard add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public AddOnConfig( global::Together.DashboardConfig? dashboard, - global::Together.IngressConfig? ingress) + global::Together.IngressConfig? ingress, + global::Together.TorchpassConfig? torchpass, + global::Together.SlurmWebConfig? slurmWeb, + global::Together.HeadlampConfig? headlamp) { this.Dashboard = dashboard; this.Ingress = ingress; + this.Torchpass = torchpass; + this.SlurmWeb = slurmWeb; + this.Headlamp = headlamp; } /// diff --git a/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.Json.g.cs index 20278abf..ffc724d8 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AddOnCreateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddOnCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddOnCreateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.g.cs index 744f84dc..afbcf3bb 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnCreateRequest.g.cs @@ -16,14 +16,14 @@ public sealed partial class AddOnCreateRequest public required string Name { get; set; } /// - /// Type of add-on. Valid values: 'dashboard', 'ingress'. + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass'. /// [global::System.Text.Json.Serialization.JsonPropertyName("add_on_type")] [global::System.Text.Json.Serialization.JsonRequired] public required string AddOnType { get; set; } /// - /// + /// Configuration for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("config")] public global::Together.AddOnConfig? Config { get; set; } @@ -41,9 +41,11 @@ public sealed partial class AddOnCreateRequest /// Human-readable name for this add-on instance. /// /// - /// Type of add-on. Valid values: 'dashboard', 'ingress'. + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass'. + /// + /// + /// Configuration for a cluster add-on. /// - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Together/Generated/Together.Models.AddOnInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddOnInfo.Json.g.cs index b8d462ea..0e4d7f7f 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AddOnInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddOnInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddOnInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AddOnInfo.g.cs b/src/libs/Together/Generated/Together.Models.AddOnInfo.g.cs index c9e6fd2b..d761b741 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnInfo.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnInfo.g.cs @@ -23,14 +23,14 @@ public sealed partial class AddOnInfo public required string AddOnType { get; set; } /// - /// + /// Configuration for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("config")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.AddOnConfig Config { get; set; } /// - /// + /// State for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("state")] [global::System.Text.Json.Serialization.JsonRequired] @@ -47,8 +47,12 @@ public sealed partial class AddOnInfo /// /// /// - /// - /// + /// + /// Configuration for a cluster add-on. + /// + /// + /// State for a cluster add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Together/Generated/Together.Models.AddOnState.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddOnState.Json.g.cs index e618aec1..12976903 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnState.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnState.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AddOnState; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddOnState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddOnState; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AddOnState.g.cs b/src/libs/Together/Generated/Together.Models.AddOnState.g.cs index bf2bd658..2702041e 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnState.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnState.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// State for a cluster add-on. /// public sealed partial class AddOnState { @@ -20,6 +20,24 @@ public sealed partial class AddOnState [global::System.Text.Json.Serialization.JsonPropertyName("ingress")] public global::Together.IngressState? Ingress { get; set; } + /// + /// State for the Model Aware TorchPass add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("torchpass")] + public global::Together.TorchpassState? Torchpass { get; set; } + + /// + /// State for the Slurm Web add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slurm_web")] + public global::Together.SlurmWebState? SlurmWeb { get; set; } + + /// + /// State for the Headlamp Kubernetes dashboard add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("headlamp")] + public global::Together.HeadlampState? Headlamp { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -31,15 +49,30 @@ public sealed partial class AddOnState /// /// /// + /// + /// State for the Model Aware TorchPass add-on. + /// + /// + /// State for the Slurm Web add-on. + /// + /// + /// State for the Headlamp Kubernetes dashboard add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public AddOnState( global::Together.DashboardState? dashboard, - global::Together.IngressState? ingress) + global::Together.IngressState? ingress, + global::Together.TorchpassState? torchpass, + global::Together.SlurmWebState? slurmWeb, + global::Together.HeadlampState? headlamp) { this.Dashboard = dashboard; this.Ingress = ingress; + this.Torchpass = torchpass; + this.SlurmWeb = slurmWeb; + this.Headlamp = headlamp; } /// diff --git a/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.Json.g.cs index 1a7743ba..8096edec 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AddOnUpdateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddOnUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddOnUpdateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.g.cs b/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.g.cs index 7fd32df3..66aed984 100644 --- a/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddOnUpdateRequest.g.cs @@ -16,7 +16,7 @@ public sealed partial class AddOnUpdateRequest public required string Name { get; set; } /// - /// + /// Configuration for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("config")] public global::Together.AddOnConfig? Config { get; set; } @@ -33,7 +33,9 @@ public sealed partial class AddOnUpdateRequest /// /// Name of the add-on to update. Must match an existing add-on on the cluster. /// - /// + /// + /// Configuration for a cluster add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.Json.g.cs new file mode 100644 index 00000000..0dfba44d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ApproveRemediationRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ApproveRemediationRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ApproveRemediationRequest), + jsonSerializerContext) as global::Together.ApproveRemediationRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ApproveRemediationRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ApproveRemediationRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ApproveRemediationRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ApproveRemediationRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.g.cs b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.g.cs new file mode 100644 index 00000000..4bc722b3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequest.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request body for approving a pending remediation. + /// + public sealed partial class ApproveRemediationRequest + { + /// + /// Approval comment explaining the decision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("comment")] + public string? Comment { get; set; } + + /// + /// Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
+ /// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
+ /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("mode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter))] + public global::Together.ApproveRemediationRequestMode? Mode { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Approval comment explaining the decision. + /// + /// + /// Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
+ /// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
+ /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ApproveRemediationRequest( + string? comment, + global::Together.ApproveRemediationRequestMode? mode) + { + this.Comment = comment; + this.Mode = mode; + } + + /// + /// Initializes a new instance of the class. + /// + public ApproveRemediationRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ApproveRemediationRequestMode.g.cs b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequestMode.g.cs new file mode 100644 index 00000000..effee7b5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ApproveRemediationRequestMode.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Together +{ + /// + /// Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
+ /// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
+ /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. + ///
+ public enum ApproveRemediationRequestMode + { + /// + /// Evicts the VM without provisioning a replacement. + /// + RemediationModeEvictWithoutReplacement, + /// + /// Cordons the host, deletes the VM, and provisions a new one on a different host. + /// + RemediationModeHostAware, + /// + /// Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. + /// + RemediationModeHostPowerCycle, + /// + /// Reboots the VM in place. + /// + RemediationModeRebootVm, + /// + /// Deletes the VM and provisions a new one on any available host. + /// + RemediationModeVmOnly, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ApproveRemediationRequestModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ApproveRemediationRequestMode value) + { + return value switch + { + ApproveRemediationRequestMode.RemediationModeEvictWithoutReplacement => "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", + ApproveRemediationRequestMode.RemediationModeHostAware => "REMEDIATION_MODE_HOST_AWARE", + ApproveRemediationRequestMode.RemediationModeHostPowerCycle => "REMEDIATION_MODE_HOST_POWER_CYCLE", + ApproveRemediationRequestMode.RemediationModeRebootVm => "REMEDIATION_MODE_REBOOT_VM", + ApproveRemediationRequestMode.RemediationModeVmOnly => "REMEDIATION_MODE_VM_ONLY", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ApproveRemediationRequestMode? ToEnum(string value) + { + return value switch + { + "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT" => ApproveRemediationRequestMode.RemediationModeEvictWithoutReplacement, + "REMEDIATION_MODE_HOST_AWARE" => ApproveRemediationRequestMode.RemediationModeHostAware, + "REMEDIATION_MODE_HOST_POWER_CYCLE" => ApproveRemediationRequestMode.RemediationModeHostPowerCycle, + "REMEDIATION_MODE_REBOOT_VM" => ApproveRemediationRequestMode.RemediationModeRebootVm, + "REMEDIATION_MODE_VM_ONLY" => ApproveRemediationRequestMode.RemediationModeVmOnly, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.AudioRef.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioRef.Json.g.cs index 26e05156..fb8fd648 100644 --- a/src/libs/Together/Generated/Together.Models.AudioRef.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioRef.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioRef; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioRef? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioRef; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechRequest.Json.g.cs index dc00719b..db04e9c5 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechRequestExtraParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechRequestExtraParams.Json.g.cs index 12d199a3..bbd345ab 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechRequestExtraParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechRequestExtraParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechRequestExtraParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechRequestExtraParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechRequestExtraParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunk.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunk.Json.g.cs index cbc28525..483dd8b0 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunk.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunk.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechStreamChunk; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechStreamChunk? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechStreamChunk; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunkObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunkObject.Json.g.cs index 0394e2a1..0beeeb5a 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunkObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamChunkObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechStreamChunkObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechStreamChunkObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechStreamChunkObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamEvent.Json.g.cs index bc1574c8..c2d29569 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechStreamEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechStreamEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechStreamEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamResponse.Json.g.cs index 8cb65f08..8dcdd3bc 100644 --- a/src/libs/Together/Generated/Together.Models.AudioSpeechStreamResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioSpeechStreamResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioSpeechStreamResponse?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioSpeechStreamResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioSpeechStreamResponse?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionJsonResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionJsonResponse.Json.g.cs index a7aefdf6..e9551d81 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionJsonResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionJsonResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionJsonResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionJsonResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionJsonResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.Json.g.cs index 4f9f57c1..34f85c56 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.g.cs index 0a3c1936..7eb3071d 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionRequest.g.cs @@ -9,7 +9,7 @@ namespace Together public sealed partial class AudioTranscriptionRequest { /// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// [global::System.Text.Json.Serialization.JsonPropertyName("file")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] @@ -49,10 +49,10 @@ public sealed partial class AudioTranscriptionRequest /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -105,7 +105,7 @@ public sealed partial class AudioTranscriptionRequest /// Initializes a new instance of the class. ///
/// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for transcription
@@ -125,7 +125,7 @@ public sealed partial class AudioTranscriptionRequest /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -163,7 +163,7 @@ public AudioTranscriptionRequest( string? language, string? prompt, global::Together.AudioTranscriptionRequestResponseFormat? responseFormat, - float? temperature, + double? temperature, global::Together.OneOf>? timestampGranularities, bool? diarize, int? minSpeakers, diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionResponse.Json.g.cs index 757ac9ae..8a2e4862 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionResponse?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionResponse?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.Json.g.cs index 56280133..8125b565 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionSegment; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionSegment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionSegment; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.g.cs index 7e71b54d..e9639d21 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSegment.g.cs @@ -19,12 +19,12 @@ public sealed partial class AudioTranscriptionSegment /// /// Start time of the segment in seconds
- /// Example: 0 + /// Example: 0.0 ///
- /// 0 + /// 0.0 [global::System.Text.Json.Serialization.JsonPropertyName("start")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Start { get; set; } + public required double Start { get; set; } /// /// End time of the segment in seconds
@@ -33,7 +33,7 @@ public sealed partial class AudioTranscriptionSegment /// 3.5 [global::System.Text.Json.Serialization.JsonPropertyName("end")] [global::System.Text.Json.Serialization.JsonRequired] - public required float End { get; set; } + public required double End { get; set; } /// /// The text content of the segment
@@ -59,7 +59,7 @@ public sealed partial class AudioTranscriptionSegment /// /// /// Start time of the segment in seconds
- /// Example: 0 + /// Example: 0.0 /// /// /// End time of the segment in seconds
@@ -74,8 +74,8 @@ public sealed partial class AudioTranscriptionSegment #endif public AudioTranscriptionSegment( int id, - float start, - float end, + double start, + double end, string text) { this.Id = id; diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.Json.g.cs index 8576456e..b77a65c7 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionSpeakerSegment; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionSpeakerSegment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionSpeakerSegment; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.g.cs index e9fb0773..ab8f5661 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionSpeakerSegment.g.cs @@ -19,12 +19,12 @@ public sealed partial class AudioTranscriptionSpeakerSegment /// /// Start time of the speaker segment in seconds
- /// Example: 0 + /// Example: 0.0 ///
- /// 0 + /// 0.0 [global::System.Text.Json.Serialization.JsonPropertyName("start")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Start { get; set; } + public required double Start { get; set; } /// /// End time of the speaker segment in seconds
@@ -33,7 +33,7 @@ public sealed partial class AudioTranscriptionSpeakerSegment /// 30.02 [global::System.Text.Json.Serialization.JsonPropertyName("end")] [global::System.Text.Json.Serialization.JsonRequired] - public required float End { get; set; } + public required double End { get; set; } /// /// Array of words spoken by this speaker in this segment @@ -75,7 +75,7 @@ public sealed partial class AudioTranscriptionSpeakerSegment /// /// /// Start time of the speaker segment in seconds
- /// Example: 0 + /// Example: 0.0 /// /// /// End time of the speaker segment in seconds
@@ -97,8 +97,8 @@ public sealed partial class AudioTranscriptionSpeakerSegment #endif public AudioTranscriptionSpeakerSegment( string speakerId, - float start, - float end, + double start, + double end, global::System.Collections.Generic.IList words, string text, int id) diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.Json.g.cs index 53f998ca..c7f6f35e 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionVerboseJsonResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionVerboseJsonResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionVerboseJsonResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.g.cs index a86439a2..4cc6a6b4 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionVerboseJsonResponse.g.cs @@ -24,7 +24,7 @@ public sealed partial class AudioTranscriptionVerboseJsonResponse /// 3.5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Duration { get; set; } + public required double Duration { get; set; } /// /// The transcribed text
@@ -89,7 +89,7 @@ public sealed partial class AudioTranscriptionVerboseJsonResponse #endif public AudioTranscriptionVerboseJsonResponse( string language, - float duration, + double duration, string text, global::System.Collections.Generic.IList segments, global::System.Collections.Generic.IList? words, diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.Json.g.cs index e74d7c2f..15e10c0f 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranscriptionWord; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranscriptionWord? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranscriptionWord; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.g.cs index c31d93d7..4481ec9c 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranscriptionWord.g.cs @@ -19,12 +19,12 @@ public sealed partial class AudioTranscriptionWord /// /// Start time of the word in seconds
- /// Example: 0 + /// Example: 0.0 ///
- /// 0 + /// 0.0 [global::System.Text.Json.Serialization.JsonPropertyName("start")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Start { get; set; } + public required double Start { get; set; } /// /// End time of the word in seconds
@@ -33,7 +33,7 @@ public sealed partial class AudioTranscriptionWord /// 0.5 [global::System.Text.Json.Serialization.JsonPropertyName("end")] [global::System.Text.Json.Serialization.JsonRequired] - public required float End { get; set; } + public required double End { get; set; } /// /// The speaker id for the word (only when diarize is enabled)
@@ -58,7 +58,7 @@ public sealed partial class AudioTranscriptionWord /// /// /// Start time of the word in seconds
- /// Example: 0 + /// Example: 0.0 /// /// /// End time of the word in seconds
@@ -73,8 +73,8 @@ public sealed partial class AudioTranscriptionWord #endif public AudioTranscriptionWord( string word, - float start, - float end, + double start, + double end, string? speakerId) { this.Word = word ?? throw new global::System.ArgumentNullException(nameof(word)); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationJsonResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationJsonResponse.Json.g.cs index 699ed73f..92236a24 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationJsonResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationJsonResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranslationJsonResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranslationJsonResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranslationJsonResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.Json.g.cs index 54b85beb..5fe99f0b 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranslationRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranslationRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranslationRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.g.cs index 5b5f8ec4..87f2d4a3 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationRequest.g.cs @@ -9,7 +9,7 @@ namespace Together public sealed partial class AudioTranslationRequest { /// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// [global::System.Text.Json.Serialization.JsonPropertyName("file")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] @@ -49,10 +49,10 @@ public sealed partial class AudioTranslationRequest /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -74,7 +74,7 @@ public sealed partial class AudioTranslationRequest /// Initializes a new instance of the class. ///
/// - /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. /// /// /// Model to use for translation
@@ -94,7 +94,7 @@ public sealed partial class AudioTranslationRequest /// /// /// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -110,7 +110,7 @@ public AudioTranslationRequest( string? language, string? prompt, global::Together.AudioTranslationRequestResponseFormat? responseFormat, - float? temperature, + double? temperature, global::Together.OneOf>? timestampGranularities) { this.File = file; diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationResponse.Json.g.cs index 684bbe70..0d2ea304 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranslationResponse?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranslationResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranslationResponse?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.Json.g.cs index e9383a1d..890dbfad 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.AudioTranslationVerboseJsonResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AudioTranslationVerboseJsonResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.AudioTranslationVerboseJsonResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.g.cs b/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.g.cs index 7bcf2d83..a5dc710e 100644 --- a/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.AudioTranslationVerboseJsonResponse.g.cs @@ -24,7 +24,7 @@ public sealed partial class AudioTranslationVerboseJsonResponse /// 3.5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Duration { get; set; } + public required double Duration { get; set; } /// /// The translated text
@@ -80,7 +80,7 @@ public sealed partial class AudioTranslationVerboseJsonResponse #endif public AudioTranslationVerboseJsonResponse( string language, - float duration, + double duration, string text, global::System.Collections.Generic.IList segments, global::System.Collections.Generic.IList? words) diff --git a/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs b/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs index f5c94636..4c1f1e22 100644 --- a/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.Autoscaling; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Autoscaling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.Autoscaling; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.BatchErrorResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.BatchErrorResponse.Json.g.cs index 7eb106cf..5d4569f7 100644 --- a/src/libs/Together/Generated/Together.Models.BatchErrorResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.BatchErrorResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.BatchErrorResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.BatchErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.BatchErrorResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.BatchJob.Json.g.cs b/src/libs/Together/Generated/Together.Models.BatchJob.Json.g.cs index d165a8ee..510c175f 100644 --- a/src/libs/Together/Generated/Together.Models.BatchJob.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.BatchJob.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.BatchJob; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.BatchJob? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.BatchJob; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.BatchJob.g.cs b/src/libs/Together/Generated/Together.Models.BatchJob.g.cs index d39f4382..d4385c5f 100644 --- a/src/libs/Together/Generated/Together.Models.BatchJob.g.cs +++ b/src/libs/Together/Generated/Together.Models.BatchJob.g.cs @@ -69,9 +69,9 @@ public sealed partial class BatchJob /// /// Completion progress (0.0 to 100)
- /// Example: 75 + /// Example: 75.0 ///
- /// 75 + /// 75.0 [global::System.Text.Json.Serialization.JsonPropertyName("progress")] public double? Progress { get; set; } @@ -147,7 +147,7 @@ public sealed partial class BatchJob /// /// /// Completion progress (0.0 to 100)
- /// Example: 75 + /// Example: 75.0 /// /// /// Model used for processing requests
diff --git a/src/libs/Together/Generated/Together.Models.BatchJobWithWarning.Json.g.cs b/src/libs/Together/Generated/Together.Models.BatchJobWithWarning.Json.g.cs index 2ca08ebd..88d0f019 100644 --- a/src/libs/Together/Generated/Together.Models.BatchJobWithWarning.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.BatchJobWithWarning.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.BatchJobWithWarning; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.BatchJobWithWarning? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.BatchJobWithWarning; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.Json.g.cs index 4dae6769..997061ca 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionAssistantMessageParam; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionAssistantMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionAssistantMessageParam; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs index e89446e3..86884774 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionAssistantMessageParamFunctionCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionAssistantMessageParamFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionAssistantMessageParamFunctionCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoice.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoice.Json.g.cs index 9d79cc32..fb7038eb 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChoice.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoice? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.Json.g.cs index 3a2b6aee..d1c6d823 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChoiceDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoiceDelta? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChoiceDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs index bb518820..5ee63b31 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoicesDataItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoicesDataItem.Json.g.cs index 77c8e481..fe666422 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChoicesDataItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoicesDataItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChoicesDataItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoicesDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChoicesDataItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunk.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunk.Json.g.cs index fe62393e..0f553b40 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunk.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunk.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChunk; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunk? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunk; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoice.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoice.Json.g.cs index c2a79313..3f93f2fa 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoice.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChunkChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkChoice? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunkChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.Json.g.cs index 62336ba6..815ef0e4 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChunkChoiceDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkChoiceDelta? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunkChoiceDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs index 31d7233d..cfa7454e 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChunkChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunkChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkObject.Json.g.cs index 674d9add..bc23e189 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionChunkObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunkObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionEvent.Json.g.cs index 76e92916..86a42527 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs index 3ecc82b6..85e4963b 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionFunctionMessageParam; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionFunctionMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionFunctionMessageParam; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.Json.g.cs index dcdeedd8..512b7d20 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionMessage? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs index 06a8e4d1..3e4a6258 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionMessageFunctionCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionMessageFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionMessageFunctionCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.Json.g.cs index cb53017a..61dc6115 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionMessageParam?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionMessageParam?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.Json.g.cs index a3e1676d..d0b0b103 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs index 7a420da6..adfd3680 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs @@ -40,13 +40,13 @@ public sealed partial class ChatCompletionRequest /// A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output. ///
[global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text. /// [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] - public float? TopP { get; set; } + public double? TopP { get; set; } /// /// An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options. @@ -96,27 +96,27 @@ public sealed partial class ChatCompletionRequest /// A number between 0 and 1 that can be used as an alternative to top_p and top-k. /// [global::System.Text.Json.Serialization.JsonPropertyName("min_p")] - public float? MinP { get; set; } + public double? MinP { get; set; } /// /// A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics. /// [global::System.Text.Json.Serialization.JsonPropertyName("presence_penalty")] - public float? PresencePenalty { get; set; } + public double? PresencePenalty { get; set; } /// /// A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned. /// [global::System.Text.Json.Serialization.JsonPropertyName("frequency_penalty")] - public float? FrequencyPenalty { get; set; } + public double? FrequencyPenalty { get; set; } /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} ///
- /// {"105":21.4,"1024":-10.5} + /// {"1024":-10.5,"105":21.4} [global::System.Text.Json.Serialization.JsonPropertyName("logit_bias")] - public global::System.Collections.Generic.Dictionary? LogitBias { get; set; } + public global::System.Collections.Generic.Dictionary? LogitBias { get; set; } /// /// Seed value for reproducibility.
@@ -255,7 +255,7 @@ public sealed partial class ChatCompletionRequest /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -301,8 +301,8 @@ public ChatCompletionRequest( string model, int? maxTokens, global::System.Collections.Generic.IList? stop, - float? temperature, - float? topP, + double? temperature, + double? topP, int? topK, global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior, double? repetitionPenalty, @@ -310,10 +310,10 @@ public ChatCompletionRequest( int? logprobs, bool? echo, int? n, - float? minP, - float? presencePenalty, - float? frequencyPenalty, - global::System.Collections.Generic.Dictionary? logitBias, + double? minP, + double? presencePenalty, + double? frequencyPenalty, + global::System.Collections.Generic.Dictionary? logitBias, int? seed, global::Together.OneOf? functionCall, global::Together.ResponseFormat? responseFormat, diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestChatTemplateKwargs.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestChatTemplateKwargs.Json.g.cs index d00a277a..88399b1e 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestChatTemplateKwargs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestChatTemplateKwargs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestChatTemplateKwargs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestChatTemplateKwargs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestChatTemplateKwargs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestCompliance.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestCompliance.Json.g.cs index 4579cf09..bad7a545 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestCompliance.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestCompliance.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestCompliance; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestCompliance? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestCompliance; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestFunctionCallEnum2.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestFunctionCallEnum2.Json.g.cs index 768ebe2b..188e5a8a 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestFunctionCallEnum2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestFunctionCallEnum2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestFunctionCallEnum2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestFunctionCallEnum2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestFunctionCallEnum2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.Json.g.cs index 4b774164..6a67a733 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestLogitBias; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestLogitBias? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestLogitBias; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.g.cs index 3291b77f..51ddaa8f 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestLogitBias.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} ///
public sealed partial class ChatCompletionRequestLogitBias { diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestReasoning.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestReasoning.Json.g.cs index 92fa2352..0eaad3f0 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestReasoning.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestReasoning.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestReasoning; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestReasoning? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestReasoning; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestResponseFormatDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestResponseFormatDiscriminator.Json.g.cs index f893af67..0e66d7e2 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequestResponseFormatDiscriminator.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequestResponseFormatDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionRequestResponseFormatDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionRequestResponseFormatDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionRequestResponseFormatDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionResponse.Json.g.cs index f3d27342..63e7ad93 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionResponseObject.Json.g.cs index ee3c0cb6..558854fe 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionStream.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionStream.Json.g.cs index 4da598f7..588951cd 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionStream.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionStream.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionStream?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionStream? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionStream?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionSystemMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionSystemMessageParam.Json.g.cs index 4b8ffc45..d79b1a2b 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionSystemMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionSystemMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionSystemMessageParam; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionSystemMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionSystemMessageParam; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionToken.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionToken.Json.g.cs index cc7a2e85..d22545fc 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionToken.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionToken? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionTool.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionTool.Json.g.cs index 50578bf5..f7ecf956 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionTool.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionTool.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionTool; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionTool? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionTool; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunction.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunction.Json.g.cs index d5797e63..10a035dd 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunction.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunction.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionToolFunction; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionToolFunction? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionToolFunction; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunctionParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunctionParameters.Json.g.cs index b61e5dd4..48257098 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunctionParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionToolFunctionParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionToolFunctionParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionToolFunctionParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionToolFunctionParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionToolMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionToolMessageParam.Json.g.cs index 63bb53a0..0c585a49 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionToolMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionToolMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionToolMessageParam; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionToolMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionToolMessageParam; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContent.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContent.Json.g.cs index 47dc09ad..347e7c25 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContent?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContent?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudio.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudio.Json.g.cs index c7f65dab..594ddc88 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudio.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudio.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemAudio; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemAudio? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemAudio; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl.Json.g.cs index eefdc319..969ba3d5 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudio.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudio.Json.g.cs index 573ff775..96ac1c39 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudio.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudio.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio.Json.g.cs index e94f23bf..79a5b4fd 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant1.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant1.Json.g.cs index 6761d3ab..28589882 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant1.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant1.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2.Json.g.cs index 46a84645..5a59f17d 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl.Json.g.cs index c2d46b8e..0dee394e 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideo.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideo.Json.g.cs index 4a8e16dd..c2c376dc 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemVideo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemVideo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemVideo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl.Json.g.cs index 7db386f2..edf4d007 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageParam.Json.g.cs index abda6e04..bd9f1c29 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageParam.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionUserMessageParam.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ChatCompletionUserMessageParam; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionUserMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionUserMessageParam; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.Json.g.cs index 159472e8..21255a66 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterAddOnCreateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterAddOnCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterAddOnCreateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.g.cs index 6ddb72dc..d96fdeee 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnCreateRequest.g.cs @@ -9,21 +9,21 @@ namespace Together public sealed partial class ClusterAddOnCreateRequest { /// - /// + /// Human-readable name for this add-on instance. /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonRequired] public required string Name { get; set; } /// - /// + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass', 'headlamp'. /// [global::System.Text.Json.Serialization.JsonPropertyName("add_on_type")] [global::System.Text.Json.Serialization.JsonRequired] public required string AddOnType { get; set; } /// - /// + /// Configuration for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("config")] public global::Together.AddOnConfig? Config { get; set; } @@ -37,9 +37,15 @@ public sealed partial class ClusterAddOnCreateRequest /// /// Initializes a new instance of the class. /// - /// - /// - /// + /// + /// Human-readable name for this add-on instance. + /// + /// + /// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass', 'headlamp'. + /// + /// + /// Configuration for a cluster add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnDeleteResponse.Json.g.cs index fc0ef749..36d50d38 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnDeleteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterAddOnDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterAddOnDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterAddOnDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.Json.g.cs index db7cfa5a..17cb7902 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterAddOnUpdateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterAddOnUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterAddOnUpdateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.g.cs index c4715fe0..fb85c6e7 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnUpdateRequest.g.cs @@ -9,7 +9,7 @@ namespace Together public sealed partial class ClusterAddOnUpdateRequest { /// - /// + /// Configuration for a cluster add-on. /// [global::System.Text.Json.Serialization.JsonPropertyName("config")] public global::Together.AddOnConfig? Config { get; set; } @@ -23,7 +23,9 @@ public sealed partial class ClusterAddOnUpdateRequest /// /// Initializes a new instance of the class. /// - /// + /// + /// Configuration for a cluster add-on. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Together/Generated/Together.Models.ClusterAddOnsListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterAddOnsListResponse.Json.g.cs index dee5a81e..8bea1e08 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterAddOnsListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterAddOnsListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterAddOnsListResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterAddOnsListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterAddOnsListResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterDriverVersionInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterDriverVersionInfo.Json.g.cs index 80b189cd..cdd296be 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterDriverVersionInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterDriverVersionInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterDriverVersionInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterDriverVersionInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterDriverVersionInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterIngressConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterIngressConfig.Json.g.cs index 0be86f2c..55b8d88d 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterIngressConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterIngressConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterIngressConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterIngressConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterIngressConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ClusterPhaseTransition.Json.g.cs b/src/libs/Together/Generated/Together.Models.ClusterPhaseTransition.Json.g.cs index 8c4443d3..a0a96667 100644 --- a/src/libs/Together/Generated/Together.Models.ClusterPhaseTransition.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ClusterPhaseTransition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ClusterPhaseTransition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ClusterPhaseTransition? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ClusterPhaseTransition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CommentBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.CommentBody.Json.g.cs index 289d39f7..6c128eaa 100644 --- a/src/libs/Together/Generated/Together.Models.CommentBody.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CommentBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CommentBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CommentBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CommentBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoice.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoice.Json.g.cs index 6d2bf056..fe3a0e67 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChoice.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChoice? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.Json.g.cs index d44f377a..8c5df6bd 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChoiceDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChoiceDelta? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChoiceDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs index f3b12d0b..6f902a74 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChoiceDeltaFunctionCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoicesDataItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoicesDataItem.Json.g.cs index 57156180..322049e6 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChoicesDataItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChoicesDataItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChoicesDataItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChoicesDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChoicesDataItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChunk.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChunk.Json.g.cs index 948347d0..f3e008c9 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChunk.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChunk.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChunk; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChunk? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChunk; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionChunkObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChunkObject.Json.g.cs index 1e756ed7..b13a58a0 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChunkObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChunkObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionChunkObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChunkObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChunkObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionEvent.Json.g.cs index a5977e28..f98a57fb 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionRequest.Json.g.cs index f9e7b156..1a7fab91 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionRequest.g.cs b/src/libs/Together/Generated/Together.Models.CompletionRequest.g.cs index caa0ec01..5d020b3a 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionRequest.g.cs @@ -43,13 +43,13 @@ public sealed partial class CompletionRequest /// A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output. ///
[global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text. /// [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] - public float? TopP { get; set; } + public double? TopP { get; set; } /// /// An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options. @@ -61,7 +61,7 @@ public sealed partial class CompletionRequest /// A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition. /// [global::System.Text.Json.Serialization.JsonPropertyName("repetition_penalty")] - public float? RepetitionPenalty { get; set; } + public double? RepetitionPenalty { get; set; } /// /// If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with `data: [DONE]`. If false, return a single JSON object containing the results. @@ -100,27 +100,27 @@ public sealed partial class CompletionRequest /// A number between 0 and 1 that can be used as an alternative to top-p and top-k. /// [global::System.Text.Json.Serialization.JsonPropertyName("min_p")] - public float? MinP { get; set; } + public double? MinP { get; set; } /// /// A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics. /// [global::System.Text.Json.Serialization.JsonPropertyName("presence_penalty")] - public float? PresencePenalty { get; set; } + public double? PresencePenalty { get; set; } /// /// A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned. /// [global::System.Text.Json.Serialization.JsonPropertyName("frequency_penalty")] - public float? FrequencyPenalty { get; set; } + public double? FrequencyPenalty { get; set; } /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} ///
- /// {"105":21.4,"1024":-10.5} + /// {"1024":-10.5,"105":21.4} [global::System.Text.Json.Serialization.JsonPropertyName("logit_bias")] - public global::System.Collections.Generic.Dictionary? LogitBias { get; set; } + public global::System.Collections.Generic.Dictionary? LogitBias { get; set; } /// /// Seed value for reproducibility.
@@ -192,7 +192,7 @@ public sealed partial class CompletionRequest /// /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} /// /// /// Seed value for reproducibility.
@@ -206,19 +206,19 @@ public CompletionRequest( global::Together.AnyOf model, int? maxTokens, global::System.Collections.Generic.IList? stop, - float? temperature, - float? topP, + double? temperature, + double? topP, int? topK, - float? repetitionPenalty, + double? repetitionPenalty, bool? stream, int? logprobs, bool? echo, int? n, global::Together.AnyOf? safetyModel, - float? minP, - float? presencePenalty, - float? frequencyPenalty, - global::System.Collections.Generic.Dictionary? logitBias, + double? minP, + double? presencePenalty, + double? frequencyPenalty, + global::System.Collections.Generic.Dictionary? logitBias, int? seed) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); diff --git a/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.Json.g.cs index 014b506a..642426be 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionRequestLogitBias; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionRequestLogitBias? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionRequestLogitBias; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.g.cs b/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.g.cs index 41774b52..a0bc75b0 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionRequestLogitBias.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5} + /// Example: {"1024":-10.5,"105":21.4} ///
public sealed partial class CompletionRequestLogitBias { diff --git a/src/libs/Together/Generated/Together.Models.CompletionResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionResponse.Json.g.cs index f0964d26..73dfc656 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionResponseObject.Json.g.cs index 3286ef60..f4eabe47 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionStream.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionStream.Json.g.cs index bac85190..249dddda 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionStream.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionStream.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionStream?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionStream? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionStream?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CompletionToken.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionToken.Json.g.cs index 00cc05fb..39c9e2bd 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionToken.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CompletionToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionToken? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ContainerStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.ContainerStatus.Json.g.cs index a3ee9865..5ffefe7e 100644 --- a/src/libs/Together/Generated/Together.Models.ContainerStatus.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ContainerStatus.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ContainerStatus; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ContainerStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ContainerStatus; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.Json.g.cs b/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.Json.g.cs index 2c69319c..a070bdb0 100644 --- a/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CosineLRSchedulerArgs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CosineLRSchedulerArgs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CosineLRSchedulerArgs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.g.cs b/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.g.cs index 19fd3099..450a5e0e 100644 --- a/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.g.cs +++ b/src/libs/Together/Generated/Together.Models.CosineLRSchedulerArgs.g.cs @@ -10,11 +10,11 @@ public sealed partial class CosineLRSchedulerArgs { /// /// The ratio of the final learning rate to the peak learning rate
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("min_lr_ratio")] [global::System.Text.Json.Serialization.JsonRequired] - public required float MinLrRatio { get; set; } + public required double MinLrRatio { get; set; } /// /// Number or fraction of cycles for the cosine learning rate scheduler
@@ -22,7 +22,7 @@ public sealed partial class CosineLRSchedulerArgs ///
[global::System.Text.Json.Serialization.JsonPropertyName("num_cycles")] [global::System.Text.Json.Serialization.JsonRequired] - public required float NumCycles { get; set; } + public required double NumCycles { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -35,7 +35,7 @@ public sealed partial class CosineLRSchedulerArgs /// /// /// The ratio of the final learning rate to the peak learning rate
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Number or fraction of cycles for the cosine learning rate scheduler
@@ -45,8 +45,8 @@ public sealed partial class CosineLRSchedulerArgs [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CosineLRSchedulerArgs( - float minLrRatio, - float numCycles) + double minLrRatio, + double numCycles) { this.MinLrRatio = minLrRatio; this.NumCycles = numCycles; diff --git a/src/libs/Together/Generated/Together.Models.CreateBatchRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateBatchRequest.Json.g.cs index 0078a966..f4b4f9bb 100644 --- a/src/libs/Together/Generated/Together.Models.CreateBatchRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateBatchRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateBatchRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateBatchRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateBatchRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentRequest.Json.g.cs index 57594d16..6b63025b 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse.Json.g.cs index b3defb8a..1024504b 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse2.Json.g.cs index f92cfde4..9f74061f 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse.Json.g.cs index 72bb2b62..3cf644bf 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsSecretsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse2.Json.g.cs index 687d64b9..ba67f813 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsSecretsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsSecretsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse.Json.g.cs index 5553d7d1..a303066a 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsStorageVolumesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse2.Json.g.cs index 76aa1d2b..a620666c 100644 --- a/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateDeploymentsStorageVolumesResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateDeploymentsStorageVolumesResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs index f2113750..3a24d4c3 100644 --- a/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateEndpointRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateEndpointRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateEndpointRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateFilesUploadRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateFilesUploadRequest.Json.g.cs index 86cb39ba..5adb3c4f 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFilesUploadRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFilesUploadRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateFilesUploadRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateFilesUploadRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFilesUploadRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceRequest.Json.g.cs index d3363f05..f8ce8916 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateFineTunesEstimatePriceRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateFineTunesEstimatePriceRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFineTunesEstimatePriceRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.Json.g.cs similarity index 68% rename from src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.Json.g.cs rename to src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.Json.g.cs index 14a58d12..99d8a484 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class CreateFineTunesEstimatePriceResponse + public sealed partial class CreateFineTunesEstimatePriceResponseVariant1 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -34,14 +47,25 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.CreateFineTunesEstimatePriceResponse? FromJson( + public static global::Together.CreateFineTunesEstimatePriceResponseVariant1? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.CreateFineTunesEstimatePriceResponse), - jsonSerializerContext) as global::Together.CreateFineTunesEstimatePriceResponse; + typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant1), + jsonSerializerContext) as global::Together.CreateFineTunesEstimatePriceResponseVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateFineTunesEstimatePriceResponseVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); } /// @@ -51,11 +75,18 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.CreateFineTunesEstimatePriceResponse? FromJson( + public static global::Together.CreateFineTunesEstimatePriceResponseVariant1? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +94,25 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.CreateFineTunesEstimatePriceResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFineTunesEstimatePriceResponse; + typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFineTunesEstimatePriceResponseVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); } /// @@ -80,11 +122,18 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.g.cs similarity index 80% rename from src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.g.cs rename to src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.g.cs index bf88a522..982a15c6 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant1.g.cs @@ -6,8 +6,15 @@ namespace Together /// /// /// - public sealed partial class CreateFineTunesEstimatePriceResponse + public sealed partial class CreateFineTunesEstimatePriceResponseVariant1 { + /// + /// Whether price estimation is available for the requested fine-tune job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("estimation_available")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EstimationAvailable { get; set; } + /// /// The price of the fine-tuning job /// @@ -47,8 +54,11 @@ public sealed partial class CreateFineTunesEstimatePriceResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// + /// + /// Whether price estimation is available for the requested fine-tune job. + /// /// /// The price of the fine-tuning job /// @@ -68,13 +78,15 @@ public sealed partial class CreateFineTunesEstimatePriceResponse #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public CreateFineTunesEstimatePriceResponse( + public CreateFineTunesEstimatePriceResponseVariant1( + bool estimationAvailable, double? estimatedTotalPrice, bool? allowedToProceed, double? userLimit, double? estimatedTrainTokenCount, double? estimatedEvalTokenCount) { + this.EstimationAvailable = estimationAvailable; this.EstimatedTotalPrice = estimatedTotalPrice; this.AllowedToProceed = allowedToProceed; this.UserLimit = userLimit; @@ -83,9 +95,9 @@ public CreateFineTunesEstimatePriceResponse( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public CreateFineTunesEstimatePriceResponse() + public CreateFineTunesEstimatePriceResponseVariant1() { } diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.Json.g.cs new file mode 100644 index 00000000..d7ded551 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class CreateFineTunesEstimatePriceResponseVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.CreateFineTunesEstimatePriceResponseVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2), + jsonSerializerContext) as global::Together.CreateFineTunesEstimatePriceResponseVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateFineTunesEstimatePriceResponseVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.CreateFineTunesEstimatePriceResponseVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFineTunesEstimatePriceResponseVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.g.cs new file mode 100644 index 00000000..4b6aa2b6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class CreateFineTunesEstimatePriceResponseVariant2 + { + /// + /// Whether price estimation is available for the requested fine-tune job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("estimation_available")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EstimationAvailable { get; set; } + + /// + /// Reason price estimation is unavailable for the requested fine-tune job.
+ /// Example: multimodal_dataset + ///
+ /// multimodal_dataset + [global::System.Text.Json.Serialization.JsonPropertyName("unavailable_reason")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason UnavailableReason { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether price estimation is available for the requested fine-tune job. + /// + /// + /// Reason price estimation is unavailable for the requested fine-tune job.
+ /// Example: multimodal_dataset + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateFineTunesEstimatePriceResponseVariant2( + bool estimationAvailable, + global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason unavailableReason) + { + this.EstimationAvailable = estimationAvailable; + this.UnavailableReason = unavailableReason; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateFineTunesEstimatePriceResponseVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs new file mode 100644 index 00000000..1d18cc8c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Reason price estimation is unavailable for the requested fine-tune job.
+ /// Example: multimodal_dataset + ///
+ public enum CreateFineTunesEstimatePriceResponseVariant2UnavailableReason + { + /// + /// + /// + EvalFileInvalid, + /// + /// + /// + EvalFileNotValidated, + /// + /// + /// + MultimodalDataset, + /// + /// + /// + TrainFileInvalid, + /// + /// + /// + TrainFileNotValidated, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CreateFineTunesEstimatePriceResponseVariant2UnavailableReason value) + { + return value switch + { + CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.EvalFileInvalid => "eval_file_invalid", + CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.EvalFileNotValidated => "eval_file_not_validated", + CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.MultimodalDataset => "multimodal_dataset", + CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.TrainFileInvalid => "train_file_invalid", + CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.TrainFileNotValidated => "train_file_not_validated", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? ToEnum(string value) + { + return value switch + { + "eval_file_invalid" => CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.EvalFileInvalid, + "eval_file_not_validated" => CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.EvalFileNotValidated, + "multimodal_dataset" => CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.MultimodalDataset, + "train_file_invalid" => CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.TrainFileInvalid, + "train_file_not_validated" => CreateFineTunesEstimatePriceResponseVariant2UnavailableReason.TrainFileNotValidated, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.Json.g.cs index 2dca6db5..e8269658 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateFineTunesRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateFineTunesRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateFineTunesRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs index e82b5a1b..09c94641 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs @@ -24,7 +24,7 @@ public sealed partial class CreateFineTunesRequest public string? ValidationFile { get; set; } /// - /// Whether to use sequence packing for training.
+ /// Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
/// Default Value: true ///
[global::System.Text.Json.Serialization.JsonPropertyName("packing")] @@ -73,8 +73,7 @@ public sealed partial class CreateFineTunesRequest public global::Together.OneOf? BatchSize { get; set; } /// - /// Number of steps to accumulate gradients before performing a weight update. Effectively increases the batch size without requiring more memory. For example, with batch_size=4 and gradient_accumulation_steps=8, the effective batch size is 32.
- /// Default Value: 1 + /// Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used. ///
[global::System.Text.Json.Serialization.JsonPropertyName("gradient_accumulation_steps")] public int? GradientAccumulationSteps { get; set; } @@ -84,7 +83,7 @@ public sealed partial class CreateFineTunesRequest /// Default Value: 0.00001 ///
[global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public float? LearningRate { get; set; } + public double? LearningRate { get; set; } /// /// The learning rate scheduler to use. It specifies how the learning rate is adjusted during training.
@@ -95,24 +94,24 @@ public sealed partial class CreateFineTunesRequest /// /// The percent of steps at the start of training to linearly increase the learning rate.
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("warmup_ratio")] - public float? WarmupRatio { get; set; } + public double? WarmupRatio { get; set; } /// /// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
- /// Default Value: 1 + /// Default Value: 1.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("max_grad_norm")] - public float? MaxGradNorm { get; set; } + public double? MaxGradNorm { get; set; } /// /// Weight decay. Regularization parameter for the optimizer.
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("weight_decay")] - public float? WeightDecay { get; set; } + public double? WeightDecay { get; set; } /// /// Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42). @@ -120,6 +119,34 @@ public sealed partial class CreateFineTunesRequest [global::System.Text.Json.Serialization.JsonPropertyName("random_seed")] public int? RandomSeed { get; set; } + /// + /// Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_enabled")] + public bool? EarlyStoppingEnabled { get; set; } + + /// + /// Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
+ /// Default Value: 2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_patience")] + public int? EarlyStoppingPatience { get; set; } + + /// + /// Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.
+ /// Default Value: 0.0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_min_delta")] + public double? EarlyStoppingMinDelta { get; set; } + + /// + /// Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_warmup_evals")] + public int? EarlyStoppingWarmupEvals { get; set; } + /// /// Suffix to add to your fine-tuned model name. Must be at most 64 characters long. /// @@ -234,7 +261,7 @@ public sealed partial class CreateFineTunesRequest /// File-ID of a validation file uploaded to the Together API /// /// - /// Whether to use sequence packing for training.
+ /// Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
/// Default Value: true /// /// @@ -257,8 +284,7 @@ public sealed partial class CreateFineTunesRequest /// Default Value: max /// /// - /// Number of steps to accumulate gradients before performing a weight update. Effectively increases the batch size without requiring more memory. For example, with batch_size=4 and gradient_accumulation_steps=8, the effective batch size is 32.
- /// Default Value: 1 + /// Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used. /// /// /// Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
@@ -270,19 +296,35 @@ public sealed partial class CreateFineTunesRequest /// /// /// The percent of steps at the start of training to linearly increase the learning rate.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
- /// Default Value: 1 + /// Default Value: 1.0 /// /// /// Weight decay. Regularization parameter for the optimizer.
- /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42). /// + /// + /// Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.
+ /// Default Value: false + /// + /// + /// Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
+ /// Default Value: 2 + /// + /// + /// Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.
+ /// Default Value: 0.0 + /// + /// + /// Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.
+ /// Default Value: 1 + /// /// /// Suffix to add to your fine-tuned model name. Must be at most 64 characters long. /// @@ -338,12 +380,16 @@ public CreateFineTunesRequest( int? nEvals, global::Together.OneOf? batchSize, int? gradientAccumulationSteps, - float? learningRate, + double? learningRate, global::Together.LRScheduler? lrScheduler, - float? warmupRatio, - float? maxGradNorm, - float? weightDecay, + double? warmupRatio, + double? maxGradNorm, + double? weightDecay, int? randomSeed, + bool? earlyStoppingEnabled, + int? earlyStoppingPatience, + double? earlyStoppingMinDelta, + int? earlyStoppingWarmupEvals, string? suffix, string? wandbApiKey, string? wandbBaseUrl, @@ -375,6 +421,10 @@ public CreateFineTunesRequest( this.MaxGradNorm = maxGradNorm; this.WeightDecay = weightDecay; this.RandomSeed = randomSeed; + this.EarlyStoppingEnabled = earlyStoppingEnabled; + this.EarlyStoppingPatience = earlyStoppingPatience; + this.EarlyStoppingMinDelta = earlyStoppingMinDelta; + this.EarlyStoppingWarmupEvals = earlyStoppingWarmupEvals; this.Suffix = suffix; this.WandbApiKey = wandbApiKey; this.WandbBaseUrl = wandbBaseUrl; diff --git a/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequest.Json.g.cs index f8f4cea9..10599feb 100644 --- a/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateImagesGenerationsRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateImagesGenerationsRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateImagesGenerationsRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequestImageLora.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequestImageLora.Json.g.cs index 1963cc72..4fb008ab 100644 --- a/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequestImageLora.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateImagesGenerationsRequestImageLora.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateImagesGenerationsRequestImageLora; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateImagesGenerationsRequestImageLora? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateImagesGenerationsRequestImageLora; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateSecretRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateSecretRequest.Json.g.cs index 982509f6..33ec19ef 100644 --- a/src/libs/Together/Generated/Together.Models.CreateSecretRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateSecretRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateSecretRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateSecretRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateSecretRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateVideoBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateVideoBody.Json.g.cs index 3764a4cc..d6fb7c01 100644 --- a/src/libs/Together/Generated/Together.Models.CreateVideoBody.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateVideoBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateVideoBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateVideoBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateVideoBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CreateVolumeRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateVolumeRequest.Json.g.cs index 7e8f02a9..1ea03f8b 100644 --- a/src/libs/Together/Generated/Together.Models.CreateVolumeRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateVolumeRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CreateVolumeRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateVolumeRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateVolumeRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.Json.g.cs index 50025d70..9e624ed7 100644 --- a/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.CustomMetricAutoscalingConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CustomMetricAutoscalingConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.CustomMetricAutoscalingConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.g.cs b/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.g.cs index 0f20aa91..82422d5f 100644 --- a/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.CustomMetricAutoscalingConfig.g.cs @@ -9,7 +9,7 @@ namespace Together public sealed partial class CustomMetricAutoscalingConfig { /// - /// CustomMetricName is the Prometheus metric name. Required. Must match [a-zA-Z_:][a-zA-Z0-9_:]*
+ /// CustomMetricName is the Prometheus metric name. Must match [a-zA-Z_:][a-zA-Z0-9_:]*
/// Example: my_custom_metric ///
/// my_custom_metric @@ -43,7 +43,7 @@ public sealed partial class CustomMetricAutoscalingConfig /// Initializes a new instance of the class. ///
/// - /// CustomMetricName is the Prometheus metric name. Required. Must match [a-zA-Z_:][a-zA-Z0-9_:]*
+ /// CustomMetricName is the Prometheus metric name. Must match [a-zA-Z_:][a-zA-Z0-9_:]*
/// Example: my_custom_metric /// /// diff --git a/src/libs/Together/Generated/Together.Models.DashboardConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DashboardConfig.Json.g.cs index a67538d8..3f62aae3 100644 --- a/src/libs/Together/Generated/Together.Models.DashboardConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DashboardConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DashboardConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DashboardConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DashboardConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DashboardState.Json.g.cs b/src/libs/Together/Generated/Together.Models.DashboardState.Json.g.cs index 1da20695..53bed525 100644 --- a/src/libs/Together/Generated/Together.Models.DashboardState.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DashboardState.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DashboardState; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DashboardState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DashboardState; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DataItem3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DataItem3.Json.g.cs index b8f7c883..462a3156 100644 --- a/src/libs/Together/Generated/Together.Models.DataItem3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DataItem3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DataItem3?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DataItem3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DataItem3?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeABExperiment.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeABExperiment.Json.g.cs new file mode 100644 index 00000000..79211e4f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeABExperiment.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeABExperiment + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeABExperiment? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeABExperiment), + jsonSerializerContext) as global::Together.DeABExperiment; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeABExperiment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeABExperiment? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeABExperiment), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeABExperiment; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeABExperiment.g.cs b/src/libs/Together/Generated/Together.Models.DeABExperiment.g.cs new file mode 100644 index 00000000..60291db9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeABExperiment.g.cs @@ -0,0 +1,154 @@ + +#nullable enable + +namespace Together +{ + /// + /// Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants. + /// + public sealed partial class DeABExperiment + { + /// + /// Output only. Unique A/B experiment identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Output only. Project that owns the parent endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// Output only. Endpoint this A/B experiment belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EndpointId { get; set; } + + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Optional free-form description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Two to 20 participating deployments with exactly one control and percentages that add up to 100. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("members")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Members { get; set; } + + /// + /// Output only. Identifier of the principal that created the A/B experiment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdBy")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedBy { get; set; } + + /// + /// Output only. Timestamp when the A/B experiment was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Output only. Timestamp when the A/B experiment was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Optional opaque version tag for optimistic concurrency control. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Output only. Unique A/B experiment identifier. + /// + /// + /// Output only. Project that owns the parent endpoint. + /// + /// + /// Output only. Endpoint this A/B experiment belongs to. + /// + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + /// + /// Two to 20 participating deployments with exactly one control and percentages that add up to 100. + /// + /// + /// Output only. Identifier of the principal that created the A/B experiment. + /// + /// + /// Output only. Timestamp when the A/B experiment was created. + /// + /// + /// Output only. Timestamp when the A/B experiment was last updated. + /// + /// + /// Optional opaque version tag for optimistic concurrency control. + /// + /// + /// Optional free-form description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeABExperiment( + string id, + string projectId, + string endpointId, + string name, + global::System.Collections.Generic.IList members, + string createdBy, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string etag, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.EndpointId = endpointId ?? throw new global::System.ArgumentNullException(nameof(endpointId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); + this.CreatedBy = createdBy ?? throw new global::System.ArgumentNullException(nameof(createdBy)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeABExperiment() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeABExperimentMember.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeABExperimentMember.Json.g.cs new file mode 100644 index 00000000..285a2591 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeABExperimentMember.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeABExperimentMember + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeABExperimentMember? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeABExperimentMember), + jsonSerializerContext) as global::Together.DeABExperimentMember; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeABExperimentMember? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeABExperimentMember? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeABExperimentMember), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeABExperimentMember; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeABExperimentMember.g.cs b/src/libs/Together/Generated/Together.Models.DeABExperimentMember.g.cs new file mode 100644 index 00000000..c57df554 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeABExperimentMember.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace Together +{ + /// + /// Deployment participating in an A/B experiment. + /// + public sealed partial class DeABExperimentMember + { + /// + /// Deployment under the parent endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DeploymentId { get; set; } + + /// + /// Role of this deployment within the A/B experiment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeABExperimentMemberRole Role { get; set; } + + /// + /// Integer traffic percent in [1, 100]. Percentages across all members must sum to 100. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("percent")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Percent { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Deployment under the parent endpoint. + /// + /// + /// Role of this deployment within the A/B experiment. + /// + /// + /// Integer traffic percent in [1, 100]. Percentages across all members must sum to 100. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeABExperimentMember( + string deploymentId, + global::Together.DeABExperimentMemberRole role, + int percent) + { + this.DeploymentId = deploymentId ?? throw new global::System.ArgumentNullException(nameof(deploymentId)); + this.Role = role; + this.Percent = percent; + } + + /// + /// Initializes a new instance of the class. + /// + public DeABExperimentMember() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeABExperimentMemberRole.g.cs b/src/libs/Together/Generated/Together.Models.DeABExperimentMemberRole.g.cs new file mode 100644 index 00000000..b0e0cd61 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeABExperimentMemberRole.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Role of this deployment within the A/B experiment. + /// + public enum DeABExperimentMemberRole + { + /// + /// + /// + AbExperimentMemberRoleControl, + /// + /// + /// + AbExperimentMemberRoleVariant, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeABExperimentMemberRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeABExperimentMemberRole value) + { + return value switch + { + DeABExperimentMemberRole.AbExperimentMemberRoleControl => "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + DeABExperimentMemberRole.AbExperimentMemberRoleVariant => "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeABExperimentMemberRole? ToEnum(string value) + { + return value switch + { + "AB_EXPERIMENT_MEMBER_ROLE_CONTROL" => DeABExperimentMemberRole.AbExperimentMemberRoleControl, + "AB_EXPERIMENT_MEMBER_ROLE_VARIANT" => DeABExperimentMemberRole.AbExperimentMemberRoleVariant, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAccessEntry.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAccessEntry.Json.g.cs new file mode 100644 index 00000000..1faa4386 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAccessEntry.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAccessEntry + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAccessEntry? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAccessEntry), + jsonSerializerContext) as global::Together.DeAccessEntry; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAccessEntry? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAccessEntry? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAccessEntry), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAccessEntry; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAccessEntry.g.cs b/src/libs/Together/Generated/Together.Models.DeAccessEntry.g.cs new file mode 100644 index 00000000..531de650 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAccessEntry.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Project, API key, or organization allowed to call an endpoint. + /// + public sealed partial class DeAccessEntry + { + /// + /// Principal type. Supported values are `project`, `api_key`, and `organization`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalType { get; set; } + + /// + /// Identifier of the principal. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Principal type. Supported values are `project`, `api_key`, and `organization`. + /// + /// + /// Identifier of the principal. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeAccessEntry( + string principalType, + string principalId) + { + this.PrincipalType = principalType ?? throw new global::System.ArgumentNullException(nameof(principalType)); + this.PrincipalId = principalId ?? throw new global::System.ArgumentNullException(nameof(principalId)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeAccessEntry() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAdapterEntry.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.Json.g.cs new file mode 100644 index 00000000..19aa50a9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAdapterEntry + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAdapterEntry? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAdapterEntry), + jsonSerializerContext) as global::Together.DeAdapterEntry; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAdapterEntry? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAdapterEntry? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAdapterEntry), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAdapterEntry; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs new file mode 100644 index 00000000..38150c7d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace Together +{ + /// + /// Adapter attached to a deployment with desired revision and observed load state. + /// + public sealed partial class DeAdapterEntry + { + /// + /// Adapter model identifier attached to the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AdapterModelId { get; set; } + + /// + /// Adapter revision pinned on the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("desiredRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DesiredRevisionId { get; set; } + + /// + /// Per-cluster adapter load state reported by the controller. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("perCluster")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList PerCluster { get; set; } + + /// + /// Row-level etag required for UpdateAdapter and RemoveAdapter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterModel")] + public string? AdapterModel { get; set; } + + /// + /// Resource name of the adapter model revision pinned on the deployment, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("desiredRevision")] + public string? DesiredRevision { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adapter model identifier attached to the deployment. + /// + /// + /// Adapter revision pinned on the deployment. + /// + /// + /// Per-cluster adapter load state reported by the controller. + /// + /// + /// Row-level etag required for UpdateAdapter and RemoveAdapter. + /// + /// + /// Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + /// + /// + /// Resource name of the adapter model revision pinned on the deployment, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeAdapterEntry( + string adapterModelId, + string desiredRevisionId, + global::System.Collections.Generic.IList perCluster, + string etag, + string? adapterModel, + string? desiredRevision) + { + this.AdapterModelId = adapterModelId ?? throw new global::System.ArgumentNullException(nameof(adapterModelId)); + this.DesiredRevisionId = desiredRevisionId ?? throw new global::System.ArgumentNullException(nameof(desiredRevisionId)); + this.PerCluster = perCluster ?? throw new global::System.ArgumentNullException(nameof(perCluster)); + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + this.AdapterModel = adapterModel; + this.DesiredRevision = desiredRevision; + } + + /// + /// Initializes a new instance of the class. + /// + public DeAdapterEntry() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.Json.g.cs new file mode 100644 index 00000000..9643c88f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAddAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAddAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAddAdapterRequest), + jsonSerializerContext) as global::Together.DeAddAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAddAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAddAdapterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAddAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAddAdapterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.g.cs new file mode 100644 index 00000000..c06b3da5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAddAdapterRequest.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for attaching a LoRA adapter to a deployment that has adapter loading enabled. + /// + public sealed partial class DeAddAdapterRequest + { + /// + /// Adapter model identifier to attach. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AdapterModelId { get; set; } + + /// + /// Optional adapter revision to pin. If omitted, the latest revision is resolved at request time. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterRevisionId")] + public string? AdapterRevisionId { get; set; } + + /// + /// Whether to evict the oldest adapter if the deployment is at adapter capacity. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("force")] + public bool? Force { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adapter model identifier to attach. + /// + /// + /// Optional adapter revision to pin. If omitted, the latest revision is resolved at request time. + /// + /// + /// Whether to evict the oldest adapter if the deployment is at adapter capacity. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeAddAdapterRequest( + string adapterModelId, + string? adapterRevisionId, + bool? force) + { + this.AdapterModelId = adapterModelId ?? throw new global::System.ArgumentNullException(nameof(adapterModelId)); + this.AdapterRevisionId = adapterRevisionId; + this.Force = force; + } + + /// + /// Initializes a new instance of the class. + /// + public DeAddAdapterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAnalyticsData.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAnalyticsData.Json.g.cs new file mode 100644 index 00000000..7c6f4e2c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAnalyticsData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAnalyticsData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAnalyticsData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAnalyticsData), + jsonSerializerContext) as global::Together.DeAnalyticsData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAnalyticsData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAnalyticsData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAnalyticsData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAnalyticsData; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAnalyticsData.g.cs b/src/libs/Together/Generated/Together.Models.DeAnalyticsData.g.cs new file mode 100644 index 00000000..56aca41a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAnalyticsData.g.cs @@ -0,0 +1,90 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns. + /// + public sealed partial class DeAnalyticsData + { + /// + /// ID of the endpoint summarized by these analytics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string? EndpointId { get; set; } + + /// + /// Closed-open time range covered by the analytics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeRange")] + public global::Together.DeMetricsTimeRange? TimeRange { get; set; } + + /// + /// Aggregated metrics over the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] + public global::Together.DeEndpointMetrics? Metrics { get; set; } + + /// + /// Per-bucket metric samples, included only when `includeTimeSeries` is true. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeSeries")] + public global::System.Collections.Generic.IList? TimeSeries { get; set; } + + /// + /// Per-deployment analytics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentAnalytics")] + public global::System.Collections.Generic.IList? DeploymentAnalytics { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the endpoint summarized by these analytics. + /// + /// + /// Closed-open time range covered by the analytics. + /// + /// + /// Aggregated metrics over the time range. + /// + /// + /// Per-bucket metric samples, included only when `includeTimeSeries` is true. + /// + /// + /// Per-deployment analytics. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeAnalyticsData( + string? endpointId, + global::Together.DeMetricsTimeRange? timeRange, + global::Together.DeEndpointMetrics? metrics, + global::System.Collections.Generic.IList? timeSeries, + global::System.Collections.Generic.IList? deploymentAnalytics) + { + this.EndpointId = endpointId; + this.TimeRange = timeRange; + this.Metrics = metrics; + this.TimeSeries = timeSeries; + this.DeploymentAnalytics = deploymentAnalytics; + } + + /// + /// Initializes a new instance of the class. + /// + public DeAnalyticsData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscaling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscaling.Json.g.cs new file mode 100644 index 00000000..03d4c0a7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscaling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAutoscaling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAutoscaling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAutoscaling), + jsonSerializerContext) as global::Together.DeAutoscaling; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAutoscaling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAutoscaling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAutoscaling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAutoscaling; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscaling.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscaling.g.cs new file mode 100644 index 00000000..873b31ca --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscaling.g.cs @@ -0,0 +1,101 @@ + +#nullable enable + +namespace Together +{ + /// + /// Autoscaling configuration for a deployment. + /// + public sealed partial class DeAutoscaling + { + /// + /// Minimum number of replicas. Omit on update to preserve the current value. Set both `minReplicas` and `maxReplicas` to `0` to stop the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("minReplicas")] + public int? MinReplicas { get; set; } + + /// + /// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update preserves the current value. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxReplicas")] + public int? MaxReplicas { get; set; } + + /// + /// Time a lower replica recommendation must remain stable before scaling down. Defaults to `5m`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scaleDownWindow")] + public string? ScaleDownWindow { get; set; } + + /// + /// Stabilization window before scaling up. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scaleUpWindow")] + public string? ScaleUpWindow { get; set; } + + /// + /// Idle period after which the deployment automatically stops and releases its replicas. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scaleToZeroWindow")] + public string? ScaleToZeroWindow { get; set; } + + /// + /// Metrics and targets that drive replica recommendations. When omitted, the platform uses concurrent in-flight requests per replica. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scalingMetrics")] + public global::System.Collections.Generic.IList? ScalingMetrics { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Minimum number of replicas. Omit on update to preserve the current value. Set both `minReplicas` and `maxReplicas` to `0` to stop the deployment. + /// + /// + /// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update preserves the current value. + /// + /// + /// Time a lower replica recommendation must remain stable before scaling down. Defaults to `5m`. + /// + /// + /// Stabilization window before scaling up. + /// + /// + /// Idle period after which the deployment automatically stops and releases its replicas. + /// + /// + /// Metrics and targets that drive replica recommendations. When omitted, the platform uses concurrent in-flight requests per replica. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeAutoscaling( + int? minReplicas, + int? maxReplicas, + string? scaleDownWindow, + string? scaleUpWindow, + string? scaleToZeroWindow, + global::System.Collections.Generic.IList? scalingMetrics) + { + this.MinReplicas = minReplicas; + this.MaxReplicas = maxReplicas; + this.ScaleDownWindow = scaleDownWindow; + this.ScaleUpWindow = scaleUpWindow; + this.ScaleToZeroWindow = scaleToZeroWindow; + this.ScalingMetrics = scalingMetrics; + } + + /// + /// Initializes a new instance of the class. + /// + public DeAutoscaling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.Json.g.cs new file mode 100644 index 00000000..3fc7c4ae --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct DeAutoscalingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAutoscalingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAutoscalingResponse), + jsonSerializerContext) as global::Together.DeAutoscalingResponse?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAutoscalingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAutoscalingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAutoscalingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAutoscalingResponse?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.g.cs new file mode 100644 index 00000000..17af775e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponse.g.cs @@ -0,0 +1,272 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// Resolved autoscaling configuration returned for a deployment. + /// + public readonly partial struct DeAutoscalingResponse : global::System.IEquatable + { + /// + /// Autoscaling configuration for a deployment. + /// +#if NET6_0_OR_GREATER + public global::Together.DeAutoscaling? DeAutoscaling { get; init; } +#else + public global::Together.DeAutoscaling? DeAutoscaling { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeAutoscaling))] +#endif + public bool IsDeAutoscaling => DeAutoscaling != null; + + /// + /// + /// + public bool TryPickDeAutoscaling( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeAutoscaling? value) + { + value = DeAutoscaling; + return IsDeAutoscaling; + } + + /// + /// + /// + public global::Together.DeAutoscaling PickDeAutoscaling() => IsDeAutoscaling + ? DeAutoscaling! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeAutoscaling' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public object? DeAutoscalingResponseVariant2 { get; init; } +#else + public object? DeAutoscalingResponseVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeAutoscalingResponseVariant2))] +#endif + public bool IsDeAutoscalingResponseVariant2 => DeAutoscalingResponseVariant2 != null; + + /// + /// + /// + public bool TryPickDeAutoscalingResponseVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = DeAutoscalingResponseVariant2; + return IsDeAutoscalingResponseVariant2; + } + + /// + /// + /// + public object PickDeAutoscalingResponseVariant2() => IsDeAutoscalingResponseVariant2 + ? DeAutoscalingResponseVariant2! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeAutoscalingResponseVariant2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator DeAutoscalingResponse(global::Together.DeAutoscaling value) => new DeAutoscalingResponse((global::Together.DeAutoscaling?)value); + + /// + /// + /// + public static implicit operator global::Together.DeAutoscaling?(DeAutoscalingResponse @this) => @this.DeAutoscaling; + + /// + /// + /// + public DeAutoscalingResponse(global::Together.DeAutoscaling? value) + { + DeAutoscaling = value; + } + + /// + /// + /// + public static DeAutoscalingResponse FromDeAutoscaling(global::Together.DeAutoscaling? value) => new DeAutoscalingResponse(value); + + /// + /// + /// + public DeAutoscalingResponse( + global::Together.DeAutoscaling? deAutoscaling, + object? deAutoscalingResponseVariant2 + ) + { + DeAutoscaling = deAutoscaling; + DeAutoscalingResponseVariant2 = deAutoscalingResponseVariant2; + } + + /// + /// + /// + public object? Object => + DeAutoscalingResponseVariant2 as object ?? + DeAutoscaling as object + ; + + /// + /// + /// + public override string? ToString() => + DeAutoscaling?.ToString() ?? + DeAutoscalingResponseVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsDeAutoscaling && IsDeAutoscalingResponseVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? deAutoscaling = null, + global::System.Func? deAutoscalingResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeAutoscaling && deAutoscaling != null) + { + return deAutoscaling(DeAutoscaling!); + } + else if (IsDeAutoscalingResponseVariant2 && deAutoscalingResponseVariant2 != null) + { + return deAutoscalingResponseVariant2(DeAutoscalingResponseVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? deAutoscaling = null, + + global::System.Action? deAutoscalingResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeAutoscaling) + { + deAutoscaling?.Invoke(DeAutoscaling!); + } + else if (IsDeAutoscalingResponseVariant2) + { + deAutoscalingResponseVariant2?.Invoke(DeAutoscalingResponseVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? deAutoscaling = null, + global::System.Action? deAutoscalingResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeAutoscaling) + { + deAutoscaling?.Invoke(DeAutoscaling!); + } + else if (IsDeAutoscalingResponseVariant2) + { + deAutoscalingResponseVariant2?.Invoke(DeAutoscalingResponseVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + DeAutoscaling, + typeof(global::Together.DeAutoscaling), + DeAutoscalingResponseVariant2, + typeof(object), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(DeAutoscalingResponse other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeAutoscaling, other.DeAutoscaling) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeAutoscalingResponseVariant2, other.DeAutoscalingResponseVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(DeAutoscalingResponse obj1, DeAutoscalingResponse obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(DeAutoscalingResponse obj1, DeAutoscalingResponse obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is DeAutoscalingResponse o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.Json.g.cs new file mode 100644 index 00000000..ad2ac7c7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeAutoscalingResponseVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeAutoscalingResponseVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeAutoscalingResponseVariant2), + jsonSerializerContext) as global::Together.DeAutoscalingResponseVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeAutoscalingResponseVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeAutoscalingResponseVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeAutoscalingResponseVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeAutoscalingResponseVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.g.cs b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.g.cs new file mode 100644 index 00000000..d9521c56 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeAutoscalingResponseVariant2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeAutoscalingResponseVariant2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.Json.g.cs new file mode 100644 index 00000000..2b5d6ca0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeBlueGreenConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeBlueGreenConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeBlueGreenConfig), + jsonSerializerContext) as global::Together.DeBlueGreenConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeBlueGreenConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeBlueGreenConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeBlueGreenConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeBlueGreenConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.g.cs b/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.g.cs new file mode 100644 index 00000000..a9099386 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeBlueGreenConfig.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Blue-green strategy configuration for a single cutover to the target deployment. + /// + public sealed partial class DeBlueGreenConfig + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCanaryConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCanaryConfig.Json.g.cs new file mode 100644 index 00000000..6805f6d6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCanaryConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCanaryConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCanaryConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCanaryConfig), + jsonSerializerContext) as global::Together.DeCanaryConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCanaryConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCanaryConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCanaryConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCanaryConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCanaryConfig.g.cs b/src/libs/Together/Generated/Together.Models.DeCanaryConfig.g.cs new file mode 100644 index 00000000..83d87809 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCanaryConfig.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Canary strategy configuration for gradual traffic progression. + /// + public sealed partial class DeCanaryConfig + { + /// + /// Required progression steps. The final step must send 100 percent traffic to the target. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("steps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Steps { get; set; } + + /// + /// Optional interval between steps. Defaults to 10m if omitted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stepInterval")] + public string? StepInterval { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required progression steps. The final step must send 100 percent traffic to the target. + /// + /// + /// Optional interval between steps. Defaults to 10m if omitted. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCanaryConfig( + global::System.Collections.Generic.IList steps, + string? stepInterval) + { + this.Steps = steps ?? throw new global::System.ArgumentNullException(nameof(steps)); + this.StepInterval = stepInterval; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCanaryConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.Json.g.cs new file mode 100644 index 00000000..deb7c7a5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCancelRolloutRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCancelRolloutRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCancelRolloutRequest), + jsonSerializerContext) as global::Together.DeCancelRolloutRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCancelRolloutRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCancelRolloutRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCancelRolloutRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCancelRolloutRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.g.cs new file mode 100644 index 00000000..43e3e062 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequest.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Reason, disposition, and optional concurrency check for canceling a rollout. + /// + public sealed partial class DeCancelRolloutRequest + { + /// + /// Required human-readable reason recorded in the rollout audit trail. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Reason { get; set; } + + /// + /// Optional etag for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("disposition")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter))] + public global::Together.DeCancelRolloutRequestDisposition? Disposition { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required human-readable reason recorded in the rollout audit trail. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCancelRolloutRequest( + string reason, + string? etag, + global::Together.DeCancelRolloutRequestDisposition? disposition) + { + this.Reason = reason ?? throw new global::System.ArgumentNullException(nameof(reason)); + this.Etag = etag; + this.Disposition = disposition; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCancelRolloutRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequestDisposition.g.cs b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequestDisposition.g.cs new file mode 100644 index 00000000..7d3d613a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCancelRolloutRequestDisposition.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + /// + public enum DeCancelRolloutRequestDisposition + { + /// + /// + /// + CancelDispositionFreeze, + /// + /// + /// + CancelDispositionRevert, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeCancelRolloutRequestDispositionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeCancelRolloutRequestDisposition value) + { + return value switch + { + DeCancelRolloutRequestDisposition.CancelDispositionFreeze => "CANCEL_DISPOSITION_FREEZE", + DeCancelRolloutRequestDisposition.CancelDispositionRevert => "CANCEL_DISPOSITION_REVERT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeCancelRolloutRequestDisposition? ToEnum(string value) + { + return value switch + { + "CANCEL_DISPOSITION_FREEZE" => DeCancelRolloutRequestDisposition.CancelDispositionFreeze, + "CANCEL_DISPOSITION_REVERT" => DeCancelRolloutRequestDisposition.CancelDispositionRevert, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCertification.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCertification.Json.g.cs new file mode 100644 index 00000000..879b2531 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCertification.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCertification + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCertification? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCertification), + jsonSerializerContext) as global::Together.DeCertification; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCertification? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCertification? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCertification), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCertification; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCertification.g.cs b/src/libs/Together/Generated/Together.Models.DeCertification.g.cs new file mode 100644 index 00000000..38d2e73d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCertification.g.cs @@ -0,0 +1,142 @@ + +#nullable enable + +namespace Together +{ + /// + /// Certification result for a model, config, and optional draft-model combination. + /// + public sealed partial class DeCertification + { + /// + /// Product or serving environment for which the combination was evaluated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeCertificationTargetJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeCertificationTarget Target { get; set; } + + /// + /// Whether the model and config combination passed certification. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certificationType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeCertificationCertificationType CertificationType { get; set; } + + /// + /// Time when the certification decision was recorded. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certifiedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CertifiedAt { get; set; } + + /// + /// Service or reviewer that recorded the certification. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certifiedBy")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CertifiedBy { get; set; } + + /// + /// Human-readable certification notes or limitations. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("notes")] + public string? Notes { get; set; } + + /// + /// Resource name of the certified model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Revision identifier of the certified model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelRevisionId { get; set; } + + /// + /// Resource name of the certified draft model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("draftModel")] + public string? DraftModel { get; set; } + + /// + /// Revision identifier of the certified draft model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("draftModelRevisionId")] + public string? DraftModelRevisionId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Product or serving environment for which the combination was evaluated. + /// + /// + /// Whether the model and config combination passed certification. + /// + /// + /// Time when the certification decision was recorded. + /// + /// + /// Service or reviewer that recorded the certification. + /// + /// + /// Resource name of the certified model. + /// + /// + /// Revision identifier of the certified model. + /// + /// + /// Human-readable certification notes or limitations. + /// + /// + /// Resource name of the certified draft model. + /// + /// + /// Revision identifier of the certified draft model. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCertification( + global::Together.DeCertificationTarget target, + global::Together.DeCertificationCertificationType certificationType, + global::System.DateTime certifiedAt, + string certifiedBy, + string model, + string modelRevisionId, + string? notes, + string? draftModel, + string? draftModelRevisionId) + { + this.Target = target; + this.CertificationType = certificationType; + this.CertifiedAt = certifiedAt; + this.CertifiedBy = certifiedBy ?? throw new global::System.ArgumentNullException(nameof(certifiedBy)); + this.Notes = notes; + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.ModelRevisionId = modelRevisionId ?? throw new global::System.ArgumentNullException(nameof(modelRevisionId)); + this.DraftModel = draftModel; + this.DraftModelRevisionId = draftModelRevisionId; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCertification() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCertificationCertificationType.g.cs b/src/libs/Together/Generated/Together.Models.DeCertificationCertificationType.g.cs new file mode 100644 index 00000000..cb7a88fe --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCertificationCertificationType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether the model and config combination passed certification. + /// + public enum DeCertificationCertificationType + { + /// + /// + /// + CertificationTypeCertified, + /// + /// + /// + CertificationTypeUncertified, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeCertificationCertificationTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeCertificationCertificationType value) + { + return value switch + { + DeCertificationCertificationType.CertificationTypeCertified => "CERTIFICATION_TYPE_CERTIFIED", + DeCertificationCertificationType.CertificationTypeUncertified => "CERTIFICATION_TYPE_UNCERTIFIED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeCertificationCertificationType? ToEnum(string value) + { + return value switch + { + "CERTIFICATION_TYPE_CERTIFIED" => DeCertificationCertificationType.CertificationTypeCertified, + "CERTIFICATION_TYPE_UNCERTIFIED" => DeCertificationCertificationType.CertificationTypeUncertified, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCertificationTarget.g.cs b/src/libs/Together/Generated/Together.Models.DeCertificationTarget.g.cs new file mode 100644 index 00000000..cfb1664e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCertificationTarget.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Product or serving environment for which the combination was evaluated. + /// + public enum DeCertificationTarget + { + /// + /// + /// + CertificationTargetDeServerless, + /// + /// + /// + CertificationTargetMre, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeCertificationTargetExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeCertificationTarget value) + { + return value switch + { + DeCertificationTarget.CertificationTargetDeServerless => "CERTIFICATION_TARGET_DE_SERVERLESS", + DeCertificationTarget.CertificationTargetMre => "CERTIFICATION_TARGET_MRE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeCertificationTarget? ToEnum(string value) + { + return value switch + { + "CERTIFICATION_TARGET_DE_SERVERLESS" => DeCertificationTarget.CertificationTargetDeServerless, + "CERTIFICATION_TARGET_MRE" => DeCertificationTarget.CertificationTargetMre, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeConfig.Json.g.cs new file mode 100644 index 00000000..f52848ce --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeConfig), + jsonSerializerContext) as global::Together.DeConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeConfig.g.cs b/src/libs/Together/Generated/Together.Models.DeConfig.g.cs new file mode 100644 index 00000000..457e7e48 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfig.g.cs @@ -0,0 +1,92 @@ + +#nullable enable + +namespace Together +{ + /// + /// Resolved inference engine, orchestration framework, and selectors for one config revision. + /// + public sealed partial class DeConfig + { + /// + /// Unique config revision identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Inference engine used to serve the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("engineType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeConfigEngineTypeJsonConverter))] + public global::Together.DeConfigEngineType? EngineType { get; set; } + + /// + /// Orchestration framework used to run replicas for this config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentFramework")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeConfigDeploymentFrameworkJsonConverter))] + public global::Together.DeConfigDeploymentFramework? DeploymentFramework { get; set; } + + /// + /// Hardware and runtime selectors resolved by the config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("selectors")] + public global::System.Collections.Generic.IList? Selectors { get; set; } + + /// + /// Stable hash of the resolved selectors, used to identify equivalent configs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("selectorsHash")] + public string? SelectorsHash { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique config revision identifier. + /// + /// + /// Inference engine used to serve the model. + /// + /// + /// Orchestration framework used to run replicas for this config. + /// + /// + /// Hardware and runtime selectors resolved by the config. + /// + /// + /// Stable hash of the resolved selectors, used to identify equivalent configs. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeConfig( + string? id, + global::Together.DeConfigEngineType? engineType, + global::Together.DeConfigDeploymentFramework? deploymentFramework, + global::System.Collections.Generic.IList? selectors, + string? selectorsHash) + { + this.Id = id; + this.EngineType = engineType; + this.DeploymentFramework = deploymentFramework; + this.Selectors = selectors; + this.SelectorsHash = selectorsHash; + } + + /// + /// Initializes a new instance of the class. + /// + public DeConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeConfigDeploymentFramework.g.cs b/src/libs/Together/Generated/Together.Models.DeConfigDeploymentFramework.g.cs new file mode 100644 index 00000000..f04cf1f4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfigDeploymentFramework.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// Orchestration framework used to run replicas for this config. + /// + public enum DeConfigDeploymentFramework + { + /// + /// + /// + DeploymentFrameworkDefault, + /// + /// + /// + DeploymentFrameworkDynamo, + /// + /// + /// + DeploymentFrameworkGrove, + /// + /// + /// + DeploymentFrameworkLws, + /// + /// + /// + DeploymentFrameworkRollouts, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeConfigDeploymentFrameworkExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeConfigDeploymentFramework value) + { + return value switch + { + DeConfigDeploymentFramework.DeploymentFrameworkDefault => "DEPLOYMENT_FRAMEWORK_DEFAULT", + DeConfigDeploymentFramework.DeploymentFrameworkDynamo => "DEPLOYMENT_FRAMEWORK_DYNAMO", + DeConfigDeploymentFramework.DeploymentFrameworkGrove => "DEPLOYMENT_FRAMEWORK_GROVE", + DeConfigDeploymentFramework.DeploymentFrameworkLws => "DEPLOYMENT_FRAMEWORK_LWS", + DeConfigDeploymentFramework.DeploymentFrameworkRollouts => "DEPLOYMENT_FRAMEWORK_ROLLOUTS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeConfigDeploymentFramework? ToEnum(string value) + { + return value switch + { + "DEPLOYMENT_FRAMEWORK_DEFAULT" => DeConfigDeploymentFramework.DeploymentFrameworkDefault, + "DEPLOYMENT_FRAMEWORK_DYNAMO" => DeConfigDeploymentFramework.DeploymentFrameworkDynamo, + "DEPLOYMENT_FRAMEWORK_GROVE" => DeConfigDeploymentFramework.DeploymentFrameworkGrove, + "DEPLOYMENT_FRAMEWORK_LWS" => DeConfigDeploymentFramework.DeploymentFrameworkLws, + "DEPLOYMENT_FRAMEWORK_ROLLOUTS" => DeConfigDeploymentFramework.DeploymentFrameworkRollouts, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeConfigEngineType.g.cs b/src/libs/Together/Generated/Together.Models.DeConfigEngineType.g.cs new file mode 100644 index 00000000..631eb535 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfigEngineType.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Together +{ + /// + /// Inference engine used to serve the model. + /// + public enum DeConfigEngineType + { + /// + /// + /// + EngineTypePulsar, + /// + /// + /// + EngineTypeSglang, + /// + /// + /// + EngineTypeSmg, + /// + /// + /// + EngineTypeTgl, + /// + /// + /// + EngineTypeTrtllm, + /// + /// + /// + EngineTypeVllm, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeConfigEngineTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeConfigEngineType value) + { + return value switch + { + DeConfigEngineType.EngineTypePulsar => "ENGINE_TYPE_PULSAR", + DeConfigEngineType.EngineTypeSglang => "ENGINE_TYPE_SGLANG", + DeConfigEngineType.EngineTypeSmg => "ENGINE_TYPE_SMG", + DeConfigEngineType.EngineTypeTgl => "ENGINE_TYPE_TGL", + DeConfigEngineType.EngineTypeTrtllm => "ENGINE_TYPE_TRTLLM", + DeConfigEngineType.EngineTypeVllm => "ENGINE_TYPE_VLLM", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeConfigEngineType? ToEnum(string value) + { + return value switch + { + "ENGINE_TYPE_PULSAR" => DeConfigEngineType.EngineTypePulsar, + "ENGINE_TYPE_SGLANG" => DeConfigEngineType.EngineTypeSglang, + "ENGINE_TYPE_SMG" => DeConfigEngineType.EngineTypeSmg, + "ENGINE_TYPE_TGL" => DeConfigEngineType.EngineTypeTgl, + "ENGINE_TYPE_TRTLLM" => DeConfigEngineType.EngineTypeTrtllm, + "ENGINE_TYPE_VLLM" => DeConfigEngineType.EngineTypeVllm, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeConfigSelector.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeConfigSelector.Json.g.cs new file mode 100644 index 00000000..9f98a55c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfigSelector.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeConfigSelector + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeConfigSelector? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeConfigSelector), + jsonSerializerContext) as global::Together.DeConfigSelector; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeConfigSelector? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeConfigSelector? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeConfigSelector), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeConfigSelector; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeConfigSelector.g.cs b/src/libs/Together/Generated/Together.Models.DeConfigSelector.g.cs new file mode 100644 index 00000000..ef0651ec --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeConfigSelector.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Hardware or runtime requirement associated with a config revision. + /// + public sealed partial class DeConfigSelector + { + /// + /// Unique selector identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Selector name, such as GPU type, GPU count, or optimization profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Required value for the selector. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique selector identifier. + /// + /// + /// Selector name, such as GPU type, GPU count, or optimization profile. + /// + /// + /// Required value for the selector. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeConfigSelector( + string? id, + string? key, + string? value) + { + this.Id = id; + this.Key = key; + this.Value = value; + } + + /// + /// Initializes a new instance of the class. + /// + public DeConfigSelector() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.Json.g.cs new file mode 100644 index 00000000..c2e458e0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateABExperimentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateABExperimentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateABExperimentRequest), + jsonSerializerContext) as global::Together.DeCreateABExperimentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateABExperimentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateABExperimentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateABExperimentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateABExperimentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.g.cs new file mode 100644 index 00000000..a9b2b3e4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateABExperimentRequest.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for a managed live-traffic split across deployments under one endpoint. + /// + public sealed partial class DeCreateABExperimentRequest + { + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Optional free-form description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("members")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Members { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable A/B experiment name, unique within the endpoint. + /// + /// + /// Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100. + /// + /// + /// Optional free-form description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateABExperimentRequest( + string name, + global::System.Collections.Generic.IList members, + string? description) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateABExperimentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.Json.g.cs new file mode 100644 index 00000000..a5034172 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateDeploymentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateDeploymentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateDeploymentRequest), + jsonSerializerContext) as global::Together.DeCreateDeploymentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateDeploymentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateDeploymentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateDeploymentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateDeploymentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.g.cs new file mode 100644 index 00000000..9f8b3f6f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateDeploymentRequest.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for creating a deployment that binds a model and immutable config to an endpoint. + /// + public sealed partial class DeCreateDeploymentRequest + { + /// + /// Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelId")] + public string? ModelId { get; set; } + + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelRevisionId")] + public string? ModelRevisionId { get; set; } + + /// + /// Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("configId")] + public string? ConfigId { get; set; } + + /// + /// Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Autoscaling configuration for the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeAutoscaling Autoscaling { get; set; } + + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + public string? Config { get; set; } + + /// + /// Enables dynamic loading of LoRA adapters on the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableLora")] + public bool? EnableLora { get; set; } + + /// + /// Placement policy to use when scheduling the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("placement")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DePlacementJsonConverter))] + public global::Together.DePlacement? Placement { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string. + /// + /// + /// Autoscaling configuration for the deployment. + /// + /// + /// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset. + /// + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation. + /// + /// + /// Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset. + /// + /// + /// Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time. + /// + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model. + /// + /// + /// Enables dynamic loading of LoRA adapters on the deployment. + /// + /// + /// Placement policy to use when scheduling the deployment. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateDeploymentRequest( + string name, + global::Together.DeAutoscaling autoscaling, + string? modelId, + string? modelRevisionId, + string? configId, + string? model, + string? config, + bool? enableLora, + global::Together.DePlacement? placement) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.ModelId = modelId; + this.ModelRevisionId = modelRevisionId; + this.ConfigId = configId; + this.Model = model; + this.Autoscaling = autoscaling ?? throw new global::System.ArgumentNullException(nameof(autoscaling)); + this.Config = config; + this.EnableLora = enableLora; + this.Placement = placement; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateDeploymentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.Json.g.cs new file mode 100644 index 00000000..dd6d5553 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateEndpointRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateEndpointRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateEndpointRequest), + jsonSerializerContext) as global::Together.DeCreateEndpointRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateEndpointRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateEndpointRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateEndpointRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateEndpointRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.g.cs new file mode 100644 index 00000000..a0f40cdc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequest.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request parameters for creating an endpoint. + /// + public sealed partial class DeCreateEndpointRequest + { + /// + /// Inference-addressable endpoint name to create. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter))] + public global::Together.DeCreateEndpointRequestVisibility? Visibility { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Inference-addressable endpoint name to create. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateEndpointRequest( + string name, + global::Together.DeCreateEndpointRequestVisibility? visibility) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Visibility = visibility; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateEndpointRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequestVisibility.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequestVisibility.g.cs new file mode 100644 index 00000000..26f1be10 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateEndpointRequestVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ public enum DeCreateEndpointRequestVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeCreateEndpointRequestVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeCreateEndpointRequestVisibility value) + { + return value switch + { + DeCreateEndpointRequestVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + DeCreateEndpointRequestVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeCreateEndpointRequestVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => DeCreateEndpointRequestVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => DeCreateEndpointRequestVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.Json.g.cs new file mode 100644 index 00000000..b27c7e24 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateModelRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateModelRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateModelRequest), + jsonSerializerContext) as global::Together.DeCreateModelRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateModelRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateModelRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateModelRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.g.cs new file mode 100644 index 00000000..6873da92 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateModelRequest.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request for registering a custom model or adapter in a project. + /// + public sealed partial class DeCreateModelRequest + { + /// + /// Name for the custom model. May be bare or qualified as `<project_slug>/<model_name>`; a supplied project slug must match the project in the request path. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// Human-readable description of the model and its intended use. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// ID of the supported base model from which this model was derived. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("baseModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name for the custom model. May be bare or qualified as `<project_slug>/<model_name>`; a supplied project slug must match the project in the request path. + /// + /// + /// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted. + /// + /// + /// ID of the supported base model from which this model was derived. + /// + /// + /// Human-readable description of the model and its intended use. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateModelRequest( + string name, + string type, + string baseModelId, + string? description) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Description = description; + this.BaseModelId = baseModelId ?? throw new global::System.ArgumentNullException(nameof(baseModelId)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateModelRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.Json.g.cs new file mode 100644 index 00000000..a865bc56 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateRemoteUploadSpec + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateRemoteUploadSpec? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateRemoteUploadSpec), + jsonSerializerContext) as global::Together.DeCreateRemoteUploadSpec; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateRemoteUploadSpec? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateRemoteUploadSpec? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateRemoteUploadSpec), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateRemoteUploadSpec; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.g.cs new file mode 100644 index 00000000..31452bd6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRemoteUploadSpec.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request parameters for creating a remote upload. + /// + public sealed partial class DeCreateRemoteUploadSpec + { + /// + /// ID of the registered model that will receive the imported files. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Hugging Face repository URL or presigned archive URL to import. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("remoteUrl")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RemoteUrl { get; set; } + + /// + /// Optional source credential used to access a private remote location. The value is write-only and is not returned. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("token")] + public string? Token { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the registered model that will receive the imported files. + /// + /// + /// Hugging Face repository URL or presigned archive URL to import. + /// + /// + /// Optional source credential used to access a private remote location. The value is write-only and is not returned. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateRemoteUploadSpec( + string modelId, + string remoteUrl, + string? token) + { + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + this.RemoteUrl = remoteUrl ?? throw new global::System.ArgumentNullException(nameof(remoteUrl)); + this.Token = token; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateRemoteUploadSpec() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.Json.g.cs new file mode 100644 index 00000000..ce1e4c90 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateRolloutRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateRolloutRequest), + jsonSerializerContext) as global::Together.DeCreateRolloutRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateRolloutRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateRolloutRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateRolloutRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.g.cs new file mode 100644 index 00000000..0d769af9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequest.g.cs @@ -0,0 +1,148 @@ + +#nullable enable + +namespace Together +{ + /// + /// Strategy, metric gates, timing, and cleanup policy for shifting traffic between two deployments under one endpoint. + /// + public sealed partial class DeCreateRolloutRequest + { + /// + /// Deployment that traffic shifts away from. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sourceDeploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SourceDeploymentId { get; set; } + + /// + /// Deployment that traffic shifts toward. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetDeploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TargetDeploymentId { get; set; } + + /// + /// Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("canary")] + public global::Together.DeCanaryConfig? Canary { get; set; } + + /// + /// Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("blueGreen")] + public global::Together.DeBlueGreenConfig? BlueGreen { get; set; } + + /// + /// Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rolling")] + public global::Together.DeRollingConfig? Rolling { get; set; } + + /// + /// Optional metric gates evaluated after each step's soak. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] + public global::System.Collections.Generic.IList? Metrics { get; set; } + + /// + /// Optional per-step soak duration before the metric gate runs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stabilizationWindow")] + public string? StabilizationWindow { get; set; } + + /// + /// Optional policy for the source deployment after completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sourceCleanup")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeCreateRolloutRequestSourceCleanupJsonConverter))] + public global::Together.DeCreateRolloutRequestSourceCleanup? SourceCleanup { get; set; } + + /// + /// Optional final replica count for the source deployment after completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("finalSourceReplicas")] + public int? FinalSourceReplicas { get; set; } + + /// + /// Optional final replica count for the target deployment after completion. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("finalTargetReplicas")] + public int? FinalTargetReplicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Deployment that traffic shifts away from. + /// + /// + /// Deployment that traffic shifts toward. + /// + /// + /// Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling. + /// + /// + /// Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling. + /// + /// + /// Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen. + /// + /// + /// Optional metric gates evaluated after each step's soak. + /// + /// + /// Optional per-step soak duration before the metric gate runs. + /// + /// + /// Optional policy for the source deployment after completion. + /// + /// + /// Optional final replica count for the source deployment after completion. + /// + /// + /// Optional final replica count for the target deployment after completion. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateRolloutRequest( + string sourceDeploymentId, + string targetDeploymentId, + global::Together.DeCanaryConfig? canary, + global::Together.DeBlueGreenConfig? blueGreen, + global::Together.DeRollingConfig? rolling, + global::System.Collections.Generic.IList? metrics, + string? stabilizationWindow, + global::Together.DeCreateRolloutRequestSourceCleanup? sourceCleanup, + int? finalSourceReplicas, + int? finalTargetReplicas) + { + this.SourceDeploymentId = sourceDeploymentId ?? throw new global::System.ArgumentNullException(nameof(sourceDeploymentId)); + this.TargetDeploymentId = targetDeploymentId ?? throw new global::System.ArgumentNullException(nameof(targetDeploymentId)); + this.Canary = canary; + this.BlueGreen = blueGreen; + this.Rolling = rolling; + this.Metrics = metrics; + this.StabilizationWindow = stabilizationWindow; + this.SourceCleanup = sourceCleanup; + this.FinalSourceReplicas = finalSourceReplicas; + this.FinalTargetReplicas = finalTargetReplicas; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateRolloutRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.Json.g.cs new file mode 100644 index 00000000..b4b85ea0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateRolloutRequestEnum + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateRolloutRequestEnum), + jsonSerializerContext) as global::Together.DeCreateRolloutRequestEnum; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateRolloutRequestEnum? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateRolloutRequestEnum), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateRolloutRequestEnum; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.g.cs new file mode 100644 index 00000000..53cba3a2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeCreateRolloutRequestEnum + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.Json.g.cs new file mode 100644 index 00000000..2565b825 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateRolloutRequestEnum2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateRolloutRequestEnum2), + jsonSerializerContext) as global::Together.DeCreateRolloutRequestEnum2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateRolloutRequestEnum2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateRolloutRequestEnum2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateRolloutRequestEnum2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.g.cs new file mode 100644 index 00000000..6c686b49 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeCreateRolloutRequestEnum2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.Json.g.cs new file mode 100644 index 00000000..c5d77f77 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateRolloutRequestEnum3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateRolloutRequestEnum3), + jsonSerializerContext) as global::Together.DeCreateRolloutRequestEnum3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateRolloutRequestEnum3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateRolloutRequestEnum3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateRolloutRequestEnum3), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateRolloutRequestEnum3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.g.cs new file mode 100644 index 00000000..c52ca8d6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestEnum3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeCreateRolloutRequestEnum3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestSourceCleanup.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestSourceCleanup.g.cs new file mode 100644 index 00000000..2106a235 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateRolloutRequestSourceCleanup.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optional policy for the source deployment after completion. + /// + public enum DeCreateRolloutRequestSourceCleanup + { + /// + /// + /// + SourceCleanupPolicyDrain, + /// + /// + /// + SourceCleanupPolicyKeep, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeCreateRolloutRequestSourceCleanupExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeCreateRolloutRequestSourceCleanup value) + { + return value switch + { + DeCreateRolloutRequestSourceCleanup.SourceCleanupPolicyDrain => "SOURCE_CLEANUP_POLICY_DRAIN", + DeCreateRolloutRequestSourceCleanup.SourceCleanupPolicyKeep => "SOURCE_CLEANUP_POLICY_KEEP", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeCreateRolloutRequestSourceCleanup? ToEnum(string value) + { + return value switch + { + "SOURCE_CLEANUP_POLICY_DRAIN" => DeCreateRolloutRequestSourceCleanup.SourceCleanupPolicyDrain, + "SOURCE_CLEANUP_POLICY_KEEP" => DeCreateRolloutRequestSourceCleanup.SourceCleanupPolicyKeep, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.Json.g.cs new file mode 100644 index 00000000..a0cb9af7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateShadowExperimentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateShadowExperimentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateShadowExperimentRequest), + jsonSerializerContext) as global::Together.DeCreateShadowExperimentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateShadowExperimentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateShadowExperimentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateShadowExperimentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateShadowExperimentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.g.cs new file mode 100644 index 00000000..5a8d927c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentRequest.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Sampling strategy and optional initial targets for mirroring endpoint requests without affecting client responses. + /// + public sealed partial class DeCreateShadowExperimentRequest + { + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Endpoint source and sampling configuration for the experiment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentSource Source { get; set; } + + /// + /// Optional initial target deployments. At most 100 targets; manage later changes through the target APIs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targets")] + public global::System.Collections.Generic.IList? Targets { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + /// + /// Endpoint source and sampling configuration for the experiment. + /// + /// + /// Optional initial target deployments. At most 100 targets; manage later changes through the target APIs. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateShadowExperimentRequest( + string name, + global::Together.DeShadowExperimentSource source, + global::System.Collections.Generic.IList? targets) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.Targets = targets; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateShadowExperimentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.Json.g.cs new file mode 100644 index 00000000..60e8f77d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeCreateShadowExperimentTargetRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeCreateShadowExperimentTargetRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeCreateShadowExperimentTargetRequest), + jsonSerializerContext) as global::Together.DeCreateShadowExperimentTargetRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeCreateShadowExperimentTargetRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeCreateShadowExperimentTargetRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeCreateShadowExperimentTargetRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeCreateShadowExperimentTargetRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.g.cs new file mode 100644 index 00000000..09cd8037 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeCreateShadowExperimentTargetRequest.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Deployment under the parent endpoint that should receive mirrored requests from a shadow experiment. + /// + public sealed partial class DeCreateShadowExperimentTargetRequest + { + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Exclude it from the endpoint's live traffic split. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetDeploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TargetDeploymentId { get; set; } + + /// + /// Optional free-form target description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Exclude it from the endpoint's live traffic split. + /// + /// + /// Optional free-form target description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeCreateShadowExperimentTargetRequest( + string name, + string targetDeploymentId, + string? description) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.TargetDeploymentId = targetDeploymentId ?? throw new global::System.ArgumentNullException(nameof(targetDeploymentId)); + this.Description = description; + } + + /// + /// Initializes a new instance of the class. + /// + public DeCreateShadowExperimentTargetRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeleteResponse.Json.g.cs new file mode 100644 index 00000000..a702dac1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeleteResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeleteResponse), + jsonSerializerContext) as global::Together.DeDeleteResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeleteResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeleteResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeDeleteResponse.g.cs new file mode 100644 index 00000000..1e2fb622 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeleteResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Empty response returned after a successful delete operation. + /// + public sealed partial class DeDeleteResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeployment.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeployment.Json.g.cs new file mode 100644 index 00000000..e84b988b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeployment.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeployment + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeployment? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeployment), + jsonSerializerContext) as global::Together.DeDeployment; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeployment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeployment? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeployment), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeployment; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeployment.g.cs b/src/libs/Together/Generated/Together.Models.DeDeployment.g.cs new file mode 100644 index 00000000..dbd12edc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeployment.g.cs @@ -0,0 +1,344 @@ + +#nullable enable + +namespace Together +{ + /// + /// Serving workload that binds a model and immutable config to an endpoint and manages its replicas. + /// + public sealed partial class DeDeployment + { + /// + /// Unique deployment identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// ID of the project that owns the deployment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + public string ProjectId { get; set; } = default!; + + /// + /// ID of the endpoint that contains the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EndpointId { get; set; } + + /// + /// Project- and endpoint-qualified deployment name in the form `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as `model` in an inference request to target this deployment directly instead of using the endpoint's traffic split. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Timestamp when the deployment was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Timestamp when the deployment was last updated.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime UpdatedAt { get; set; } = default!; + + /// + /// Deprecated. Use `model`. Model identifier being served, populated during migration. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a specific model revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelRevisionId { get; set; } + + /// + /// Pinned model resource in the form `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Replica bounds, timing windows, and metrics that control horizontal scaling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeAutoscalingResponseJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeAutoscalingResponse Autoscaling { get; set; } + + /// + /// Deprecated. Use `config`. Config revision identifier, populated during migration. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("configId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ConfigId { get; set; } + + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Config { get; set; } + + /// + /// Deprecated. Use `speculator`. Speculative decoding model identifier derived from the deployment config.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("speculatorId")] + public string? SpeculatorId { get; set; } + + /// + /// Deprecated. Use `speculator`. ID of the speculative decoding draft-model revision pinned at creation time.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("speculatorRevisionId")] + public string? SpeculatorRevisionId { get; set; } + + /// + /// Pinned draft-model resource used for speculative decoding, in the same form as `model`. Omitted when speculative decoding is disabled.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("speculator")] + public string? Speculator { get; set; } + + /// + /// Estimated fraction in [0, 1] of endpoint traffic that reaches this deployment under the current routing configuration. Absent or unrouted deployments are 0.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("estimatedEffectiveTrafficShare")] + public double? EstimatedEffectiveTrafficShare { get; set; } + + /// + /// Whether the deployment can dynamically load LoRA adapters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableLora")] + public bool? EnableLora { get; set; } + + /// + /// Opaque version tag for optimistic concurrency control. Supply on update/delete to ensure consistent read-modify-write. If not set, the write overwrites based on current state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Hardware selected by the deployment config, including GPU type and count.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("hardware")] + public string Hardware { get; set; } = default!; + + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("trafficMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter))] + public global::Together.DeDeploymentTrafficMode TrafficMode { get; set; } = default!; + + /// + /// Serving engine and feature support derived from the immutable config.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("runtimeInfo")] + public global::Together.DeRuntimeInfo? RuntimeInfo { get; set; } + + /// + /// Number of replicas the autoscaler currently wants across all regions.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("desiredReplicas")] + public int? DesiredReplicas { get; set; } + + /// + /// Current lifecycle state and observed replica counts.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + public global::Together.DeDeploymentStatus Status { get; set; } = default!; + + /// + /// Region constraints used to schedule the deployment's replicas. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("placement")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DePlacementJsonConverter))] + public global::Together.DePlacement? Placement { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the endpoint that contains the deployment. + /// + /// + /// Project- and endpoint-qualified deployment name in the form `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as `model` in an inference request to target this deployment directly instead of using the endpoint's traffic split. + /// + /// + /// Deprecated. Use `model`. Model identifier being served, populated during migration. + /// + /// + /// Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a specific model revision. + /// + /// + /// Pinned model resource in the form `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. + /// + /// + /// Replica bounds, timing windows, and metrics that control horizontal scaling. + /// + /// + /// Deprecated. Use `config`. Config revision identifier, populated during migration. + /// + /// + /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. + /// + /// + /// Opaque version tag for optimistic concurrency control. Supply on update/delete to ensure consistent read-modify-write. If not set, the write overwrites based on current state. + /// + /// + /// Deprecated. Use `speculator`. Speculative decoding model identifier derived from the deployment config.
+ /// Included only in responses + /// + /// + /// Deprecated. Use `speculator`. ID of the speculative decoding draft-model revision pinned at creation time.
+ /// Included only in responses + /// + /// + /// Pinned draft-model resource used for speculative decoding, in the same form as `model`. Omitted when speculative decoding is disabled.
+ /// Included only in responses + /// + /// + /// Estimated fraction in [0, 1] of endpoint traffic that reaches this deployment under the current routing configuration. Absent or unrouted deployments are 0.
+ /// Included only in responses + /// + /// + /// Whether the deployment can dynamically load LoRA adapters. + /// + /// + /// Serving engine and feature support derived from the immutable config.
+ /// Included only in responses + /// + /// + /// Number of replicas the autoscaler currently wants across all regions.
+ /// Included only in responses + /// + /// + /// Region constraints used to schedule the deployment's replicas. + /// + /// + /// Unique deployment identifier.
+ /// Included only in responses + /// + /// + /// ID of the project that owns the deployment.
+ /// Included only in responses + /// + /// + /// Timestamp when the deployment was created.
+ /// Included only in responses + /// + /// + /// Timestamp when the deployment was last updated.
+ /// Included only in responses + /// + /// + /// Hardware selected by the deployment config, including GPU type and count.
+ /// Included only in responses + /// + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic.
+ /// Included only in responses + /// + /// + /// Current lifecycle state and observed replica counts.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeployment( + string endpointId, + string name, + string modelId, + string modelRevisionId, + string model, + global::Together.DeAutoscalingResponse autoscaling, + string configId, + string config, + string etag, + string? speculatorId, + string? speculatorRevisionId, + string? speculator, + double? estimatedEffectiveTrafficShare, + bool? enableLora, + global::Together.DeRuntimeInfo? runtimeInfo, + int? desiredReplicas, + global::Together.DePlacement? placement, + string id = default!, + string projectId = default!, + global::System.DateTime createdAt = default!, + global::System.DateTime updatedAt = default!, + string hardware = default!, + global::Together.DeDeploymentTrafficMode trafficMode = default!, + global::Together.DeDeploymentStatus status = default!) + { + this.Id = id; + this.ProjectId = projectId; + this.EndpointId = endpointId ?? throw new global::System.ArgumentNullException(nameof(endpointId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + this.ModelRevisionId = modelRevisionId ?? throw new global::System.ArgumentNullException(nameof(modelRevisionId)); + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Autoscaling = autoscaling; + this.ConfigId = configId ?? throw new global::System.ArgumentNullException(nameof(configId)); + this.Config = config ?? throw new global::System.ArgumentNullException(nameof(config)); + this.SpeculatorId = speculatorId; + this.SpeculatorRevisionId = speculatorRevisionId; + this.Speculator = speculator; + this.EstimatedEffectiveTrafficShare = estimatedEffectiveTrafficShare; + this.EnableLora = enableLora; + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + this.Hardware = hardware; + this.TrafficMode = trafficMode; + this.RuntimeInfo = runtimeInfo; + this.DesiredReplicas = desiredReplicas; + this.Status = status; + this.Placement = placement; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeployment() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.Json.g.cs new file mode 100644 index 00000000..0943b685 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeploymentAdapterStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeploymentAdapterStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeploymentAdapterStatus), + jsonSerializerContext) as global::Together.DeDeploymentAdapterStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeploymentAdapterStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeploymentAdapterStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeploymentAdapterStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeploymentAdapterStatus; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.g.cs new file mode 100644 index 00000000..6b1bb56b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatus.g.cs @@ -0,0 +1,196 @@ + +#nullable enable + +namespace Together +{ + /// + /// Controller-reported load state for an adapter on one deployment cluster. + /// + public sealed partial class DeDeploymentAdapterStatus + { + /// + /// Adapter model identifier for this status row. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AdapterModelId { get; set; } + + /// + /// Cluster reporting this adapter status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("clusterId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ClusterId { get; set; } + + /// + /// Adapter revision currently loaded on pods in this cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("realizedRevisionId")] + public string? RealizedRevisionId { get; set; } + + /// + /// Adapter row etag observed by the controller when it wrote this status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("realizedEtag")] + public string? RealizedEtag { get; set; } + + /// + /// Current adapter load state in this cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeDeploymentAdapterStatusState State { get; set; } + + /// + /// Stable reason code for the current adapter state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Human-readable details about the current adapter state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Number of pods with the adapter ready to serve. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("readyPodCount")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int ReadyPodCount { get; set; } + + /// + /// Number of pods that failed to load the adapter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("failedPodCount")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int FailedPodCount { get; set; } + + /// + /// Total pods expected to report adapter load state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalPodCount")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TotalPodCount { get; set; } + + /// + /// Time when the adapter first reached READY in this cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("loadedAt")] + public global::System.DateTime? LoadedAt { get; set; } + + /// + /// Time when this adapter status was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime? UpdatedAt { get; set; } + + /// + /// Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterModel")] + public string? AdapterModel { get; set; } + + /// + /// Resource name of the adapter model revision currently loaded in this cluster, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("realizedRevision")] + public string? RealizedRevision { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adapter model identifier for this status row. + /// + /// + /// Cluster reporting this adapter status. + /// + /// + /// Current adapter load state in this cluster. + /// + /// + /// Number of pods with the adapter ready to serve. + /// + /// + /// Number of pods that failed to load the adapter. + /// + /// + /// Total pods expected to report adapter load state. + /// + /// + /// Adapter revision currently loaded on pods in this cluster. + /// + /// + /// Adapter row etag observed by the controller when it wrote this status. + /// + /// + /// Stable reason code for the current adapter state. + /// + /// + /// Human-readable details about the current adapter state. + /// + /// + /// Time when the adapter first reached READY in this cluster. + /// + /// + /// Time when this adapter status was last updated. + /// + /// + /// Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + /// + /// + /// Resource name of the adapter model revision currently loaded in this cluster, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeploymentAdapterStatus( + string adapterModelId, + string clusterId, + global::Together.DeDeploymentAdapterStatusState state, + int readyPodCount, + int failedPodCount, + int totalPodCount, + string? realizedRevisionId, + string? realizedEtag, + string? reason, + string? message, + global::System.DateTime? loadedAt, + global::System.DateTime? updatedAt, + string? adapterModel, + string? realizedRevision) + { + this.AdapterModelId = adapterModelId ?? throw new global::System.ArgumentNullException(nameof(adapterModelId)); + this.ClusterId = clusterId ?? throw new global::System.ArgumentNullException(nameof(clusterId)); + this.RealizedRevisionId = realizedRevisionId; + this.RealizedEtag = realizedEtag; + this.State = state; + this.Reason = reason; + this.Message = message; + this.ReadyPodCount = readyPodCount; + this.FailedPodCount = failedPodCount; + this.TotalPodCount = totalPodCount; + this.LoadedAt = loadedAt; + this.UpdatedAt = updatedAt; + this.AdapterModel = adapterModel; + this.RealizedRevision = realizedRevision; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeploymentAdapterStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatusState.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatusState.g.cs new file mode 100644 index 00000000..2440c6ba --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentAdapterStatusState.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current adapter load state in this cluster. + /// + public enum DeDeploymentAdapterStatusState + { + /// + /// + /// + AdapterLoadStateFailed, + /// + /// + /// + AdapterLoadStateLoading, + /// + /// + /// + AdapterLoadStatePending, + /// + /// + /// + AdapterLoadStateReady, + /// + /// + /// + AdapterLoadStateRemoving, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeDeploymentAdapterStatusStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeDeploymentAdapterStatusState value) + { + return value switch + { + DeDeploymentAdapterStatusState.AdapterLoadStateFailed => "ADAPTER_LOAD_STATE_FAILED", + DeDeploymentAdapterStatusState.AdapterLoadStateLoading => "ADAPTER_LOAD_STATE_LOADING", + DeDeploymentAdapterStatusState.AdapterLoadStatePending => "ADAPTER_LOAD_STATE_PENDING", + DeDeploymentAdapterStatusState.AdapterLoadStateReady => "ADAPTER_LOAD_STATE_READY", + DeDeploymentAdapterStatusState.AdapterLoadStateRemoving => "ADAPTER_LOAD_STATE_REMOVING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeDeploymentAdapterStatusState? ToEnum(string value) + { + return value switch + { + "ADAPTER_LOAD_STATE_FAILED" => DeDeploymentAdapterStatusState.AdapterLoadStateFailed, + "ADAPTER_LOAD_STATE_LOADING" => DeDeploymentAdapterStatusState.AdapterLoadStateLoading, + "ADAPTER_LOAD_STATE_PENDING" => DeDeploymentAdapterStatusState.AdapterLoadStatePending, + "ADAPTER_LOAD_STATE_READY" => DeDeploymentAdapterStatusState.AdapterLoadStateReady, + "ADAPTER_LOAD_STATE_REMOVING" => DeDeploymentAdapterStatusState.AdapterLoadStateRemoving, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.Json.g.cs new file mode 100644 index 00000000..05b1bd98 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeploymentAnalyticsData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeploymentAnalyticsData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeploymentAnalyticsData), + jsonSerializerContext) as global::Together.DeDeploymentAnalyticsData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeploymentAnalyticsData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeploymentAnalyticsData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeploymentAnalyticsData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeploymentAnalyticsData; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.g.cs new file mode 100644 index 00000000..fd84a99d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentAnalyticsData.g.cs @@ -0,0 +1,90 @@ + +#nullable enable + +namespace Together +{ + /// + /// Usage and performance analytics for one deployment under an endpoint. + /// + public sealed partial class DeDeploymentAnalyticsData + { + /// + /// ID of the deployment summarized by these analytics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentId")] + public string? DeploymentId { get; set; } + + /// + /// ID of the deployment's parent endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string? EndpointId { get; set; } + + /// + /// Closed-open time range covered by the analytics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeRange")] + public global::Together.DeMetricsTimeRange? TimeRange { get; set; } + + /// + /// Aggregate operational metrics for the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] + public global::Together.DeDeploymentMetrics? Metrics { get; set; } + + /// + /// Per-bucket metric samples for the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeSeries")] + public global::System.Collections.Generic.IList? TimeSeries { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the deployment summarized by these analytics. + /// + /// + /// ID of the deployment's parent endpoint. + /// + /// + /// Closed-open time range covered by the analytics. + /// + /// + /// Aggregate operational metrics for the deployment. + /// + /// + /// Per-bucket metric samples for the deployment. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeploymentAnalyticsData( + string? deploymentId, + string? endpointId, + global::Together.DeMetricsTimeRange? timeRange, + global::Together.DeDeploymentMetrics? metrics, + global::System.Collections.Generic.IList? timeSeries) + { + this.DeploymentId = deploymentId; + this.EndpointId = endpointId; + this.TimeRange = timeRange; + this.Metrics = metrics; + this.TimeSeries = timeSeries; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeploymentAnalyticsData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.Json.g.cs new file mode 100644 index 00000000..e4e12bb7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeploymentMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeploymentMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeploymentMetrics), + jsonSerializerContext) as global::Together.DeDeploymentMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeploymentMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeploymentMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeploymentMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeploymentMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.g.cs new file mode 100644 index 00000000..2de95555 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentMetrics.g.cs @@ -0,0 +1,134 @@ + +#nullable enable + +namespace Together +{ + /// + /// Operational metrics for one deployment under an endpoint. + /// + public sealed partial class DeDeploymentMetrics + { + /// + /// ID of the deployment summarized by these metrics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentId")] + public string? DeploymentId { get; set; } + + /// + /// ID of the deployment's parent endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string? EndpointId { get; set; } + + /// + /// Closed-open time range covered by the metrics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeRange")] + public global::Together.DeMetricsTimeRange? TimeRange { get; set; } + + /// + /// Request counts and rates. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requestMetrics")] + public global::Together.DeRequestMetrics? RequestMetrics { get; set; } + + /// + /// Time-to-first-token, end-to-end, and inter-token latency percentiles. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latencyMetrics")] + public global::Together.DeLatencyMetrics? LatencyMetrics { get; set; } + + /// + /// Token, request, and batching throughput. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("throughputMetrics")] + public global::Together.DeThroughputMetrics? ThroughputMetrics { get; set; } + + /// + /// Error rate and counts by error type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errorMetrics")] + public global::Together.DeErrorMetrics? ErrorMetrics { get; set; } + + /// + /// Average CPU, GPU, memory, and network utilization. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resourceUtilization")] + public global::Together.DeResourceUtilization? ResourceUtilization { get; set; } + + /// + /// Input and output token totals and averages. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokenMetrics")] + public global::Together.DeTokenMetrics? TokenMetrics { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the deployment summarized by these metrics. + /// + /// + /// ID of the deployment's parent endpoint. + /// + /// + /// Closed-open time range covered by the metrics. + /// + /// + /// Request counts and rates. + /// + /// + /// Time-to-first-token, end-to-end, and inter-token latency percentiles. + /// + /// + /// Token, request, and batching throughput. + /// + /// + /// Error rate and counts by error type. + /// + /// + /// Average CPU, GPU, memory, and network utilization. + /// + /// + /// Input and output token totals and averages. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeploymentMetrics( + string? deploymentId, + string? endpointId, + global::Together.DeMetricsTimeRange? timeRange, + global::Together.DeRequestMetrics? requestMetrics, + global::Together.DeLatencyMetrics? latencyMetrics, + global::Together.DeThroughputMetrics? throughputMetrics, + global::Together.DeErrorMetrics? errorMetrics, + global::Together.DeResourceUtilization? resourceUtilization, + global::Together.DeTokenMetrics? tokenMetrics) + { + this.DeploymentId = deploymentId; + this.EndpointId = endpointId; + this.TimeRange = timeRange; + this.RequestMetrics = requestMetrics; + this.LatencyMetrics = latencyMetrics; + this.ThroughputMetrics = throughputMetrics; + this.ErrorMetrics = errorMetrics; + this.ResourceUtilization = resourceUtilization; + this.TokenMetrics = tokenMetrics; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeploymentMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.Json.g.cs new file mode 100644 index 00000000..c7b9197c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeploymentStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeploymentStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeploymentStatus), + jsonSerializerContext) as global::Together.DeDeploymentStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeploymentStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeploymentStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeploymentStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeploymentStatus; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.g.cs new file mode 100644 index 00000000..a80dae57 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentStatus.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current status of a deployment, derived at read time from internal state. + /// + public sealed partial class DeDeploymentStatus + { + /// + /// High-level lifecycle state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeDeploymentStatusState State { get; set; } + + /// + /// Total replicas actively serving traffic across all clusters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("readyReplicas")] + public int? ReadyReplicas { get; set; } + + /// + /// Human-readable explanation of the current state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Replicas the scheduler has placed on clusters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scheduledReplicas")] + public int? ScheduledReplicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// High-level lifecycle state. + /// + /// + /// Human-readable explanation of the current state. + /// + /// + /// Total replicas actively serving traffic across all clusters. + /// + /// + /// Replicas the scheduler has placed on clusters. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeploymentStatus( + global::Together.DeDeploymentStatusState state, + string message, + int? readyReplicas, + int? scheduledReplicas) + { + this.State = state; + this.ReadyReplicas = readyReplicas; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.ScheduledReplicas = scheduledReplicas; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeploymentStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentStatusState.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentStatusState.g.cs new file mode 100644 index 00000000..84f2cab8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentStatusState.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace Together +{ + /// + /// High-level lifecycle state. + /// + public enum DeDeploymentStatusState + { + /// + /// + /// + DeploymentStateDegraded, + /// + /// + /// + DeploymentStateFailed, + /// + /// + /// + DeploymentStateProvisioning, + /// + /// + /// + DeploymentStateReady, + /// + /// + /// + DeploymentStateScaling, + /// + /// + /// + DeploymentStateStopped, + /// + /// + /// + DeploymentStateStopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeDeploymentStatusStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeDeploymentStatusState value) + { + return value switch + { + DeDeploymentStatusState.DeploymentStateDegraded => "DEPLOYMENT_STATE_DEGRADED", + DeDeploymentStatusState.DeploymentStateFailed => "DEPLOYMENT_STATE_FAILED", + DeDeploymentStatusState.DeploymentStateProvisioning => "DEPLOYMENT_STATE_PROVISIONING", + DeDeploymentStatusState.DeploymentStateReady => "DEPLOYMENT_STATE_READY", + DeDeploymentStatusState.DeploymentStateScaling => "DEPLOYMENT_STATE_SCALING", + DeDeploymentStatusState.DeploymentStateStopped => "DEPLOYMENT_STATE_STOPPED", + DeDeploymentStatusState.DeploymentStateStopping => "DEPLOYMENT_STATE_STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeDeploymentStatusState? ToEnum(string value) + { + return value switch + { + "DEPLOYMENT_STATE_DEGRADED" => DeDeploymentStatusState.DeploymentStateDegraded, + "DEPLOYMENT_STATE_FAILED" => DeDeploymentStatusState.DeploymentStateFailed, + "DEPLOYMENT_STATE_PROVISIONING" => DeDeploymentStatusState.DeploymentStateProvisioning, + "DEPLOYMENT_STATE_READY" => DeDeploymentStatusState.DeploymentStateReady, + "DEPLOYMENT_STATE_SCALING" => DeDeploymentStatusState.DeploymentStateScaling, + "DEPLOYMENT_STATE_STOPPED" => DeDeploymentStatusState.DeploymentStateStopped, + "DEPLOYMENT_STATE_STOPPING" => DeDeploymentStatusState.DeploymentStateStopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.Json.g.cs new file mode 100644 index 00000000..70c30441 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeDeploymentSummary + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeDeploymentSummary? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeDeploymentSummary), + jsonSerializerContext) as global::Together.DeDeploymentSummary; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeDeploymentSummary? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeDeploymentSummary? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeDeploymentSummary), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeDeploymentSummary; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.g.cs new file mode 100644 index 00000000..145a0a64 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentSummary.g.cs @@ -0,0 +1,205 @@ + +#nullable enable + +namespace Together +{ + /// + /// Compact deployment status embedded in an endpoint response. + /// + public sealed partial class DeDeploymentSummary + { + /// + /// Deployment identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// Deprecated. Use `model`. Model identifier being served. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Hardware configuration selected by the deployment's config, such as its GPU type and count.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("hardware")] + public string? Hardware { get; set; } + + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trafficMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeDeploymentSummaryTrafficMode TrafficMode { get; set; } + + /// + /// Current state of the deployment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter))] + public global::Together.DeDeploymentSummaryState State { get; set; } = default!; + + /// + /// Inference-addressable name in the fully-qualified form
+ /// "<project_slug>/<endpoint_name>/<deployment_name>". Pass it as the
+ /// "model" field when calling the inference API to pin to this deployment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = default!; + + /// + /// Timestamp when the deployment was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Autoscaling configuration for the deployment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeAutoscalingResponseJsonConverter))] + public global::Together.DeAutoscalingResponse Autoscaling { get; set; } = default!; + + /// + /// Number of replicas the autoscaler currently wants across all regions.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("desiredReplicas")] + public int? DesiredReplicas { get; set; } + + /// + /// Number of replicas currently ready to serve requests across all regions.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("readyReplicas")] + public int? ReadyReplicas { get; set; } + + /// + /// Resource name of the served model in the form
+ /// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
+ /// For public models, the model's owning project may differ from the deployment's project. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Estimated fraction from 0 to 1 of endpoint traffic currently routed to this deployment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("estimatedEffectiveTrafficShare")] + public double EstimatedEffectiveTrafficShare { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Deprecated. Use `model`. Model identifier being served. + /// + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic. + /// + /// + /// Resource name of the served model in the form
+ /// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
+ /// For public models, the model's owning project may differ from the deployment's project. + /// + /// + /// Hardware configuration selected by the deployment's config, such as its GPU type and count.
+ /// Included only in responses + /// + /// + /// Number of replicas the autoscaler currently wants across all regions.
+ /// Included only in responses + /// + /// + /// Number of replicas currently ready to serve requests across all regions.
+ /// Included only in responses + /// + /// + /// Deployment identifier.
+ /// Included only in responses + /// + /// + /// Current state of the deployment.
+ /// Included only in responses + /// + /// + /// Inference-addressable name in the fully-qualified form
+ /// "<project_slug>/<endpoint_name>/<deployment_name>". Pass it as the
+ /// "model" field when calling the inference API to pin to this deployment.
+ /// Included only in responses + /// + /// + /// Timestamp when the deployment was created.
+ /// Included only in responses + /// + /// + /// Autoscaling configuration for the deployment.
+ /// Included only in responses + /// + /// + /// Estimated fraction from 0 to 1 of endpoint traffic currently routed to this deployment.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeDeploymentSummary( + string modelId, + global::Together.DeDeploymentSummaryTrafficMode trafficMode, + string model, + string? hardware, + int? desiredReplicas, + int? readyReplicas, + string id = default!, + global::Together.DeDeploymentSummaryState state = default!, + string name = default!, + global::System.DateTime createdAt = default!, + global::Together.DeAutoscalingResponse autoscaling = default!, + double estimatedEffectiveTrafficShare = default!) + { + this.Id = id; + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + this.Hardware = hardware; + this.TrafficMode = trafficMode; + this.State = state; + this.Name = name; + this.CreatedAt = createdAt; + this.Autoscaling = autoscaling; + this.DesiredReplicas = desiredReplicas; + this.ReadyReplicas = readyReplicas; + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.EstimatedEffectiveTrafficShare = estimatedEffectiveTrafficShare; + } + + /// + /// Initializes a new instance of the class. + /// + public DeDeploymentSummary() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryState.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryState.g.cs new file mode 100644 index 00000000..81397066 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryState.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current state of the deployment.
+ /// Included only in responses + ///
+ public enum DeDeploymentSummaryState + { + /// + /// + /// + DeploymentStateDegraded, + /// + /// + /// + DeploymentStateFailed, + /// + /// + /// + DeploymentStateProvisioning, + /// + /// + /// + DeploymentStateReady, + /// + /// + /// + DeploymentStateScaling, + /// + /// + /// + DeploymentStateStopped, + /// + /// + /// + DeploymentStateStopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeDeploymentSummaryStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeDeploymentSummaryState value) + { + return value switch + { + DeDeploymentSummaryState.DeploymentStateDegraded => "DEPLOYMENT_STATE_DEGRADED", + DeDeploymentSummaryState.DeploymentStateFailed => "DEPLOYMENT_STATE_FAILED", + DeDeploymentSummaryState.DeploymentStateProvisioning => "DEPLOYMENT_STATE_PROVISIONING", + DeDeploymentSummaryState.DeploymentStateReady => "DEPLOYMENT_STATE_READY", + DeDeploymentSummaryState.DeploymentStateScaling => "DEPLOYMENT_STATE_SCALING", + DeDeploymentSummaryState.DeploymentStateStopped => "DEPLOYMENT_STATE_STOPPED", + DeDeploymentSummaryState.DeploymentStateStopping => "DEPLOYMENT_STATE_STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeDeploymentSummaryState? ToEnum(string value) + { + return value switch + { + "DEPLOYMENT_STATE_DEGRADED" => DeDeploymentSummaryState.DeploymentStateDegraded, + "DEPLOYMENT_STATE_FAILED" => DeDeploymentSummaryState.DeploymentStateFailed, + "DEPLOYMENT_STATE_PROVISIONING" => DeDeploymentSummaryState.DeploymentStateProvisioning, + "DEPLOYMENT_STATE_READY" => DeDeploymentSummaryState.DeploymentStateReady, + "DEPLOYMENT_STATE_SCALING" => DeDeploymentSummaryState.DeploymentStateScaling, + "DEPLOYMENT_STATE_STOPPED" => DeDeploymentSummaryState.DeploymentStateStopped, + "DEPLOYMENT_STATE_STOPPING" => DeDeploymentSummaryState.DeploymentStateStopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryTrafficMode.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryTrafficMode.g.cs new file mode 100644 index 00000000..56f1d4ca --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentSummaryTrafficMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic. + /// + public enum DeDeploymentSummaryTrafficMode + { + /// + /// + /// + TrafficModeLive, + /// + /// + /// + TrafficModeShadow, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeDeploymentSummaryTrafficModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeDeploymentSummaryTrafficMode value) + { + return value switch + { + DeDeploymentSummaryTrafficMode.TrafficModeLive => "TRAFFIC_MODE_LIVE", + DeDeploymentSummaryTrafficMode.TrafficModeShadow => "TRAFFIC_MODE_SHADOW", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeDeploymentSummaryTrafficMode? ToEnum(string value) + { + return value switch + { + "TRAFFIC_MODE_LIVE" => DeDeploymentSummaryTrafficMode.TrafficModeLive, + "TRAFFIC_MODE_SHADOW" => DeDeploymentSummaryTrafficMode.TrafficModeShadow, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeDeploymentTrafficMode.g.cs b/src/libs/Together/Generated/Together.Models.DeDeploymentTrafficMode.g.cs new file mode 100644 index 00000000..8dfab9eb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeDeploymentTrafficMode.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether the deployment serves client-visible responses or only mirrored shadow traffic.
+ /// Included only in responses + ///
+ public enum DeDeploymentTrafficMode + { + /// + /// + /// + TrafficModeLive, + /// + /// + /// + TrafficModeShadow, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeDeploymentTrafficModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeDeploymentTrafficMode value) + { + return value switch + { + DeDeploymentTrafficMode.TrafficModeLive => "TRAFFIC_MODE_LIVE", + DeDeploymentTrafficMode.TrafficModeShadow => "TRAFFIC_MODE_SHADOW", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeDeploymentTrafficMode? ToEnum(string value) + { + return value switch + { + "TRAFFIC_MODE_LIVE" => DeDeploymentTrafficMode.TrafficModeLive, + "TRAFFIC_MODE_SHADOW" => DeDeploymentTrafficMode.TrafficModeShadow, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpoint.Json.g.cs new file mode 100644 index 00000000..538b6f9e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeEndpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeEndpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeEndpoint), + jsonSerializerContext) as global::Together.DeEndpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeEndpoint? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeEndpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeEndpoint; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeEndpoint.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpoint.g.cs new file mode 100644 index 00000000..2045aa82 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpoint.g.cs @@ -0,0 +1,195 @@ + +#nullable enable + +namespace Together +{ + /// + /// Stable inference entry point that groups deployments and routes requests among them. + /// + public sealed partial class DeEndpoint + { + /// + /// Unique endpoint identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// ID of the project that owns the endpoint.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + public string ProjectId { get; set; } = default!; + + /// + /// Project-qualified endpoint name in the form `<project_slug>/<endpoint_name>`.
+ /// Pass this value as `model` in inference requests. Create and update requests
+ /// may use either a bare endpoint name or the qualified form; a supplied project
+ /// slug must match the project in the request path. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Timestamp when the endpoint was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Output only. Timestamp when the endpoint was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Opaque version tag for optimistic concurrency control.
+ /// Supply on update/delete to ensure consistent read-modify-write.
+ /// If not set, the write overwrites based on current state. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Deployments eligible for live traffic and their capacity weights. An empty list leaves the endpoint unrouted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trafficSplit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList TrafficSplit { get; set; } + + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ /// global::Together.DeEndpointVisibility.VisibilityPrivate + [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeEndpointVisibilityJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeEndpointVisibility Visibility { get; set; } = global::Together.DeEndpointVisibility.VisibilityPrivate; + + /// + /// Serving class of the endpoint.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("endpointType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter))] + public global::Together.DeEndpointEndpointType EndpointType { get; set; } = default!; + + /// + /// Lightweight summaries of deployments under this endpoint.
+ /// Retrieve a deployment through the endpoint's deployment API for full details.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("deployments")] + public global::System.Collections.Generic.IList Deployments { get; set; } = default!; + + /// + /// ID of the currently active rollout, or empty if none.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("activeRolloutId")] + public string? ActiveRolloutId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Project-qualified endpoint name in the form `<project_slug>/<endpoint_name>`.
+ /// Pass this value as `model` in inference requests. Create and update requests
+ /// may use either a bare endpoint name or the qualified form; a supplied project
+ /// slug must match the project in the request path. + /// + /// + /// Output only. Timestamp when the endpoint was last updated. + /// + /// + /// Opaque version tag for optimistic concurrency control.
+ /// Supply on update/delete to ensure consistent read-modify-write.
+ /// If not set, the write overwrites based on current state. + /// + /// + /// Deployments eligible for live traffic and their capacity weights. An empty list leaves the endpoint unrouted. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// + /// ID of the currently active rollout, or empty if none.
+ /// Included only in responses + /// + /// + /// Unique endpoint identifier.
+ /// Included only in responses + /// + /// + /// ID of the project that owns the endpoint.
+ /// Included only in responses + /// + /// + /// Timestamp when the endpoint was created.
+ /// Included only in responses + /// + /// + /// Serving class of the endpoint.
+ /// Included only in responses + /// + /// + /// Lightweight summaries of deployments under this endpoint.
+ /// Retrieve a deployment through the endpoint's deployment API for full details.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeEndpoint( + string name, + global::System.DateTime updatedAt, + string etag, + global::System.Collections.Generic.IList trafficSplit, + global::Together.DeEndpointVisibility visibility, + string? activeRolloutId, + string id = default!, + string projectId = default!, + global::System.DateTime createdAt = default!, + global::Together.DeEndpointEndpointType endpointType = default!, + global::System.Collections.Generic.IList deployments = default!) + { + this.Id = id; + this.ProjectId = projectId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + this.TrafficSplit = trafficSplit ?? throw new global::System.ArgumentNullException(nameof(trafficSplit)); + this.Visibility = visibility; + this.EndpointType = endpointType; + this.Deployments = deployments; + this.ActiveRolloutId = activeRolloutId; + } + + /// + /// Initializes a new instance of the class. + /// + public DeEndpoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointEndpointType.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointEndpointType.g.cs new file mode 100644 index 00000000..d75d1533 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointEndpointType.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Serving class of the endpoint.
+ /// Included only in responses + ///
+ public enum DeEndpointEndpointType + { + /// + /// + /// + EndpointTypeDedicated, + /// + /// + /// + EndpointTypeServerless, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeEndpointEndpointTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeEndpointEndpointType value) + { + return value switch + { + DeEndpointEndpointType.EndpointTypeDedicated => "ENDPOINT_TYPE_DEDICATED", + DeEndpointEndpointType.EndpointTypeServerless => "ENDPOINT_TYPE_SERVERLESS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeEndpointEndpointType? ToEnum(string value) + { + return value switch + { + "ENDPOINT_TYPE_DEDICATED" => DeEndpointEndpointType.EndpointTypeDedicated, + "ENDPOINT_TYPE_SERVERLESS" => DeEndpointEndpointType.EndpointTypeServerless, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointEvent.Json.g.cs new file mode 100644 index 00000000..93e51fa5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointEvent.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeEndpointEvent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeEndpointEvent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeEndpointEvent), + jsonSerializerContext) as global::Together.DeEndpointEvent; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeEndpointEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeEndpointEvent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeEndpointEvent), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeEndpointEvent; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointEvent.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointEvent.g.cs new file mode 100644 index 00000000..614fec69 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointEvent.g.cs @@ -0,0 +1,297 @@ + +#nullable enable + +namespace Together +{ + /// + /// One endpoint- or deployment-scoped entry in an endpoint's combined audit and lifecycle feed. + /// + public sealed partial class DeEndpointEvent + { + /// + /// Output only. Unique event identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Output only. Event creation time. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Output only. Severity level. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("level")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeEndpointEventLevelJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeEndpointEventLevel Level { get; set; } + + /// + /// Output only. Stable event type, such as `endpoint.updated`, `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// Output only. Human-readable description of the event. Short and stable; not structured data. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Output only. Service, cluster, or controller that emitted the event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Source { get; set; } + + /// + /// Output only. Whether this row describes the endpoint or one of its deployments. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sourceKind")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeEndpointEventSourceKind SourceKind { get; set; } + + /// + /// Output only. The endpoint this event belongs to. Always set. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EndpointId { get; set; } + + /// + /// Output only. Deployment associated with the event when `sourceKind` is `SOURCE_KIND_DEPLOYMENT`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentId")] + public string? DeploymentId { get; set; } + + /// + /// Output only. ID of the event's subject, such as a rollout, shadow target, or condition type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("subjectId")] + public string? SubjectId { get; set; } + + /// + /// Resource name at the time of the event. Populated by: deployment.created, deployment.deleted, endpoint.created, endpoint.deleted + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Field-mask paths that were modified. Populated by: deployment.updated, endpoint.updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("paths")] + public global::System.Collections.Generic.IList? Paths { get; set; } + + /// + /// Replica-count transition. Populated by: deployment.scaled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("oldReplicas")] + public int? OldReplicas { get; set; } + + /// + /// New replica count for a `deployment.scaled` event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("newReplicas")] + public int? NewReplicas { get; set; } + + /// + /// Target version. Populated by `target.created`; the target ID is carried in `subjectId`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + public int? Version { get; set; } + + /// + /// Condition status for `condition.set` and `cluster_condition.set`: `True`, `False`, or `Unknown`. The condition type is carried in `subjectId`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or `ApplySuccessful`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// ID of the cluster associated with a cluster-scoped event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("clusterId")] + public string? ClusterId { get; set; } + + /// + /// Deployment subservice associated with the event, such as `model-deployment` or `speculator-deployment`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("serviceType")] + public string? ServiceType { get; set; } + + /// + /// Opaque replica identity associated with a `pod.*` event, stable for grouping events from the same replica. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replicaId")] + public string? ReplicaId { get; set; } + + /// + /// Stable public component label associated with a replica event, such as `engine`, `model-download`, or `sidecar`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("containerName")] + public string? ContainerName { get; set; } + + /// + /// Short diagnostic log excerpt captured with a pod event, for example during a crash, out-of-memory termination, or image pull failure. This field is truncated and is not a streaming log API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("logExcerpt")] + public string? LogExcerpt { get; set; } + + /// + /// Opaque node handle for correlating replica failures on the same node. Omitted when the replica is unscheduled or the node is unknown. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nodeId")] + public string? NodeId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Output only. Unique event identifier. + /// + /// + /// Output only. Event creation time. + /// + /// + /// Output only. Severity level. + /// + /// + /// Output only. Stable event type, such as `endpoint.updated`, `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`. + /// + /// + /// Output only. Service, cluster, or controller that emitted the event. + /// + /// + /// Output only. Whether this row describes the endpoint or one of its deployments. + /// + /// + /// Output only. The endpoint this event belongs to. Always set. + /// + /// + /// Output only. Human-readable description of the event. Short and stable; not structured data. + /// + /// + /// Output only. Deployment associated with the event when `sourceKind` is `SOURCE_KIND_DEPLOYMENT`. + /// + /// + /// Output only. ID of the event's subject, such as a rollout, shadow target, or condition type. + /// + /// + /// Resource name at the time of the event. Populated by: deployment.created, deployment.deleted, endpoint.created, endpoint.deleted + /// + /// + /// Field-mask paths that were modified. Populated by: deployment.updated, endpoint.updated + /// + /// + /// Replica-count transition. Populated by: deployment.scaled + /// + /// + /// New replica count for a `deployment.scaled` event. + /// + /// + /// Target version. Populated by `target.created`; the target ID is carried in `subjectId`. + /// + /// + /// Condition status for `condition.set` and `cluster_condition.set`: `True`, `False`, or `Unknown`. The condition type is carried in `subjectId`. + /// + /// + /// Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or `ApplySuccessful`. + /// + /// + /// ID of the cluster associated with a cluster-scoped event. + /// + /// + /// Deployment subservice associated with the event, such as `model-deployment` or `speculator-deployment`. + /// + /// + /// Opaque replica identity associated with a `pod.*` event, stable for grouping events from the same replica. + /// + /// + /// Stable public component label associated with a replica event, such as `engine`, `model-download`, or `sidecar`. + /// + /// + /// Short diagnostic log excerpt captured with a pod event, for example during a crash, out-of-memory termination, or image pull failure. This field is truncated and is not a streaming log API. + /// + /// + /// Opaque node handle for correlating replica failures on the same node. Omitted when the replica is unscheduled or the node is unknown. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeEndpointEvent( + string id, + global::System.DateTime createdAt, + global::Together.DeEndpointEventLevel level, + string type, + string source, + global::Together.DeEndpointEventSourceKind sourceKind, + string endpointId, + string? message, + string? deploymentId, + string? subjectId, + string? name, + global::System.Collections.Generic.IList? paths, + int? oldReplicas, + int? newReplicas, + int? version, + string? status, + string? reason, + string? clusterId, + string? serviceType, + string? replicaId, + string? containerName, + string? logExcerpt, + string? nodeId) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.CreatedAt = createdAt; + this.Level = level; + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Message = message; + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.SourceKind = sourceKind; + this.EndpointId = endpointId ?? throw new global::System.ArgumentNullException(nameof(endpointId)); + this.DeploymentId = deploymentId; + this.SubjectId = subjectId; + this.Name = name; + this.Paths = paths; + this.OldReplicas = oldReplicas; + this.NewReplicas = newReplicas; + this.Version = version; + this.Status = status; + this.Reason = reason; + this.ClusterId = clusterId; + this.ServiceType = serviceType; + this.ReplicaId = replicaId; + this.ContainerName = containerName; + this.LogExcerpt = logExcerpt; + this.NodeId = nodeId; + } + + /// + /// Initializes a new instance of the class. + /// + public DeEndpointEvent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointEventLevel.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointEventLevel.g.cs new file mode 100644 index 00000000..656fbb48 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointEventLevel.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Output only. Severity level. + /// + public enum DeEndpointEventLevel + { + /// + /// + /// + LevelDebug, + /// + /// + /// + LevelError, + /// + /// + /// + LevelInfo, + /// + /// + /// + LevelWarn, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeEndpointEventLevelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeEndpointEventLevel value) + { + return value switch + { + DeEndpointEventLevel.LevelDebug => "LEVEL_DEBUG", + DeEndpointEventLevel.LevelError => "LEVEL_ERROR", + DeEndpointEventLevel.LevelInfo => "LEVEL_INFO", + DeEndpointEventLevel.LevelWarn => "LEVEL_WARN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeEndpointEventLevel? ToEnum(string value) + { + return value switch + { + "LEVEL_DEBUG" => DeEndpointEventLevel.LevelDebug, + "LEVEL_ERROR" => DeEndpointEventLevel.LevelError, + "LEVEL_INFO" => DeEndpointEventLevel.LevelInfo, + "LEVEL_WARN" => DeEndpointEventLevel.LevelWarn, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointEventSourceKind.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointEventSourceKind.g.cs new file mode 100644 index 00000000..b1adb071 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointEventSourceKind.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Output only. Whether this row describes the endpoint or one of its deployments. + /// + public enum DeEndpointEventSourceKind + { + /// + /// + /// + SourceKindDeployment, + /// + /// + /// + SourceKindEndpoint, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeEndpointEventSourceKindExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeEndpointEventSourceKind value) + { + return value switch + { + DeEndpointEventSourceKind.SourceKindDeployment => "SOURCE_KIND_DEPLOYMENT", + DeEndpointEventSourceKind.SourceKindEndpoint => "SOURCE_KIND_ENDPOINT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeEndpointEventSourceKind? ToEnum(string value) + { + return value switch + { + "SOURCE_KIND_DEPLOYMENT" => DeEndpointEventSourceKind.SourceKindDeployment, + "SOURCE_KIND_ENDPOINT" => DeEndpointEventSourceKind.SourceKindEndpoint, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.Json.g.cs new file mode 100644 index 00000000..44acb1f8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeEndpointMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeEndpointMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeEndpointMetrics), + jsonSerializerContext) as global::Together.DeEndpointMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeEndpointMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeEndpointMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeEndpointMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeEndpointMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.g.cs new file mode 100644 index 00000000..b7ec8fe1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointMetrics.g.cs @@ -0,0 +1,134 @@ + +#nullable enable + +namespace Together +{ + /// + /// Operational metrics aggregated across all deployments receiving traffic for an endpoint. + /// + public sealed partial class DeEndpointMetrics + { + /// + /// The endpoint these metrics describe. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string? EndpointId { get; set; } + + /// + /// Time range covered by the metrics. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeRange")] + public global::Together.DeMetricsTimeRange? TimeRange { get; set; } + + /// + /// Request counts and rates. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requestMetrics")] + public global::Together.DeRequestMetrics? RequestMetrics { get; set; } + + /// + /// Time-to-first-token, end-to-end, and inter-token latency percentiles. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latencyMetrics")] + public global::Together.DeLatencyMetrics? LatencyMetrics { get; set; } + + /// + /// Token, request, and batching throughput. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("throughputMetrics")] + public global::Together.DeThroughputMetrics? ThroughputMetrics { get; set; } + + /// + /// Error rate and counts by error type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errorMetrics")] + public global::Together.DeErrorMetrics? ErrorMetrics { get; set; } + + /// + /// Average CPU, GPU, memory, and network utilization. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resourceUtilization")] + public global::Together.DeResourceUtilization? ResourceUtilization { get; set; } + + /// + /// Input and output token totals and averages. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokenMetrics")] + public global::Together.DeTokenMetrics? TokenMetrics { get; set; } + + /// + /// Per-deployment breakdown, if the endpoint has multiple deployments. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentMetrics")] + public global::System.Collections.Generic.IList? DeploymentMetrics { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The endpoint these metrics describe. + /// + /// + /// Time range covered by the metrics. + /// + /// + /// Request counts and rates. + /// + /// + /// Time-to-first-token, end-to-end, and inter-token latency percentiles. + /// + /// + /// Token, request, and batching throughput. + /// + /// + /// Error rate and counts by error type. + /// + /// + /// Average CPU, GPU, memory, and network utilization. + /// + /// + /// Input and output token totals and averages. + /// + /// + /// Per-deployment breakdown, if the endpoint has multiple deployments. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeEndpointMetrics( + string? endpointId, + global::Together.DeMetricsTimeRange? timeRange, + global::Together.DeRequestMetrics? requestMetrics, + global::Together.DeLatencyMetrics? latencyMetrics, + global::Together.DeThroughputMetrics? throughputMetrics, + global::Together.DeErrorMetrics? errorMetrics, + global::Together.DeResourceUtilization? resourceUtilization, + global::Together.DeTokenMetrics? tokenMetrics, + global::System.Collections.Generic.IList? deploymentMetrics) + { + this.EndpointId = endpointId; + this.TimeRange = timeRange; + this.RequestMetrics = requestMetrics; + this.LatencyMetrics = latencyMetrics; + this.ThroughputMetrics = throughputMetrics; + this.ErrorMetrics = errorMetrics; + this.ResourceUtilization = resourceUtilization; + this.TokenMetrics = tokenMetrics; + this.DeploymentMetrics = deploymentMetrics; + } + + /// + /// Initializes a new instance of the class. + /// + public DeEndpointMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.Json.g.cs new file mode 100644 index 00000000..3ddd4f87 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeEndpointUpdate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeEndpointUpdate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeEndpointUpdate), + jsonSerializerContext) as global::Together.DeEndpointUpdate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeEndpointUpdate? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeEndpointUpdate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeEndpointUpdate), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeEndpointUpdate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.g.cs new file mode 100644 index 00000000..961a957a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointUpdate.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable endpoint fields for update requests. + /// + public sealed partial class DeEndpointUpdate + { + /// + /// Updated endpoint string. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Current endpoint version. The update is rejected if this value no longer matches. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Replacement live traffic split. Use an empty list to stop routing live traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trafficSplit")] + public global::System.Collections.Generic.IList? TrafficSplit { get; set; } + + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter))] + public global::Together.DeEndpointUpdateVisibility? Visibility { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated endpoint string. + /// + /// + /// Current endpoint version. The update is rejected if this value no longer matches. + /// + /// + /// Replacement live traffic split. Use an empty list to stop routing live traffic. + /// + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeEndpointUpdate( + string? name, + string? etag, + global::System.Collections.Generic.IList? trafficSplit, + global::Together.DeEndpointUpdateVisibility? visibility) + { + this.Name = name; + this.Etag = etag; + this.TrafficSplit = trafficSplit; + this.Visibility = visibility; + } + + /// + /// Initializes a new instance of the class. + /// + public DeEndpointUpdate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointUpdateVisibility.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointUpdateVisibility.g.cs new file mode 100644 index 00000000..094b49ea --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointUpdateVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ public enum DeEndpointUpdateVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeEndpointUpdateVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeEndpointUpdateVisibility value) + { + return value switch + { + DeEndpointUpdateVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + DeEndpointUpdateVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeEndpointUpdateVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => DeEndpointUpdateVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => DeEndpointUpdateVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeEndpointVisibility.g.cs b/src/libs/Together/Generated/Together.Models.DeEndpointVisibility.g.cs new file mode 100644 index 00000000..00e5bfc2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeEndpointVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ public enum DeEndpointVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeEndpointVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeEndpointVisibility value) + { + return value switch + { + DeEndpointVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + DeEndpointVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeEndpointVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => DeEndpointVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => DeEndpointVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeErrorMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeErrorMetrics.Json.g.cs new file mode 100644 index 00000000..d4896893 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeErrorMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeErrorMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeErrorMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeErrorMetrics), + jsonSerializerContext) as global::Together.DeErrorMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeErrorMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeErrorMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeErrorMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeErrorMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeErrorMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeErrorMetrics.g.cs new file mode 100644 index 00000000..6cdc66aa --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeErrorMetrics.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Error rate and aggregate counts by error type. Individual error samples are not included. + /// + public sealed partial class DeErrorMetrics + { + /// + /// Percentage in [0, 100]. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errorRate")] + public double? ErrorRate { get; set; } + + /// + /// Counts of errors keyed by error type (e.g. HTTP status code or error kind). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errorsByType")] + public global::System.Collections.Generic.Dictionary? ErrorsByType { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Percentage in [0, 100]. + /// + /// + /// Counts of errors keyed by error type (e.g. HTTP status code or error kind). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeErrorMetrics( + double? errorRate, + global::System.Collections.Generic.Dictionary? errorsByType) + { + this.ErrorRate = errorRate; + this.ErrorsByType = errorsByType; + } + + /// + /// Initializes a new instance of the class. + /// + public DeErrorMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.Json.g.cs new file mode 100644 index 00000000..fb620429 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeErrorMetricsErrorsByType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeErrorMetricsErrorsByType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeErrorMetricsErrorsByType), + jsonSerializerContext) as global::Together.DeErrorMetricsErrorsByType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeErrorMetricsErrorsByType? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeErrorMetricsErrorsByType? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeErrorMetricsErrorsByType), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeErrorMetricsErrorsByType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.g.cs b/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.g.cs new file mode 100644 index 00000000..9504ea30 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeErrorMetricsErrorsByType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Counts of errors keyed by error type (e.g. HTTP status code or error kind). + /// + public sealed partial class DeErrorMetricsErrorsByType + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.Json.g.cs new file mode 100644 index 00000000..c85596d0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeGrantEndpointAccessRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeGrantEndpointAccessRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeGrantEndpointAccessRequest), + jsonSerializerContext) as global::Together.DeGrantEndpointAccessRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeGrantEndpointAccessRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeGrantEndpointAccessRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeGrantEndpointAccessRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeGrantEndpointAccessRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.g.cs new file mode 100644 index 00000000..a4024c10 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeGrantEndpointAccessRequest.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Principal that should be allowed to send inference requests to the endpoint. + /// + public sealed partial class DeGrantEndpointAccessRequest + { + /// + /// Type of principal to grant. Supported values are `project`, `api_key`, and `organization`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalType { get; set; } + + /// + /// Identifier of the principal to grant access to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Type of principal to grant. Supported values are `project`, `api_key`, and `organization`. + /// + /// + /// Identifier of the principal to grant access to. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeGrantEndpointAccessRequest( + string principalType, + string principalId) + { + this.PrincipalType = principalType ?? throw new global::System.ArgumentNullException(nameof(principalType)); + this.PrincipalId = principalId ?? throw new global::System.ArgumentNullException(nameof(principalId)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeGrantEndpointAccessRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeHeadroom.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeHeadroom.Json.g.cs new file mode 100644 index 00000000..99f09471 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeHeadroom.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeHeadroom + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeHeadroom? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeHeadroom), + jsonSerializerContext) as global::Together.DeHeadroom; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeHeadroom? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeHeadroom? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeHeadroom), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeHeadroom; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeHeadroom.g.cs b/src/libs/Together/Generated/Together.Models.DeHeadroom.g.cs new file mode 100644 index 00000000..491083f0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeHeadroom.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Best-effort estimate of how many additional replicas currently fit in a region. + /// + public sealed partial class DeHeadroom + { + /// + /// Capped count of replicas that currently fit. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + public int? Value { get; set; } + + /// + /// Whether the value is exact or a lower bound. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("relation")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeHeadroomRelationJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeHeadroomRelation Relation { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the value is exact or a lower bound. + /// + /// + /// Capped count of replicas that currently fit. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeHeadroom( + global::Together.DeHeadroomRelation relation, + int? value) + { + this.Value = value; + this.Relation = relation; + } + + /// + /// Initializes a new instance of the class. + /// + public DeHeadroom() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeHeadroomRelation.g.cs b/src/libs/Together/Generated/Together.Models.DeHeadroomRelation.g.cs new file mode 100644 index 00000000..c78d3663 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeHeadroomRelation.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether the value is exact or a lower bound. + /// + public enum DeHeadroomRelation + { + /// + /// + /// + RelationEq, + /// + /// + /// + RelationGte, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeHeadroomRelationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeHeadroomRelation value) + { + return value switch + { + DeHeadroomRelation.RelationEq => "RELATION_EQ", + DeHeadroomRelation.RelationGte => "RELATION_GTE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeHeadroomRelation? ToEnum(string value) + { + return value switch + { + "RELATION_EQ" => DeHeadroomRelation.RelationEq, + "RELATION_GTE" => DeHeadroomRelation.RelationGte, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.Json.g.cs new file mode 100644 index 00000000..64632ae1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeInferenceInstanceType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeInferenceInstanceType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeInferenceInstanceType), + jsonSerializerContext) as global::Together.DeInferenceInstanceType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeInferenceInstanceType? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeInferenceInstanceType? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeInferenceInstanceType), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeInferenceInstanceType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.g.cs b/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.g.cs new file mode 100644 index 00000000..3483369d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeInferenceInstanceType.g.cs @@ -0,0 +1,131 @@ + +#nullable enable + +namespace Together +{ + /// + /// GPU hardware configuration on which one inference replica can run. + /// + public sealed partial class DeInferenceInstanceType + { + /// + /// Stable hardware instance type identifier used by deployment configs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Human-readable instance type name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Human-readable summary of the hardware configuration. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Description { get; set; } + + /// + /// GPU accelerator model, such as `H100` or `B200`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string GpuType { get; set; } + + /// + /// Number of GPUs in one replica of this instance type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuCount")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int GpuCount { get; set; } + + /// + /// Memory available on each GPU, in GiB. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuMemoryGib")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int GpuMemoryGib { get; set; } + + /// + /// On-demand price for one running replica, in US cents per hour. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("priceCentsPerHour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int PriceCentsPerHour { get; set; } + + /// + /// Regions where this instance type is offered. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("regions")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Regions { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Stable hardware instance type identifier used by deployment configs. + /// + /// + /// Human-readable instance type name. + /// + /// + /// Human-readable summary of the hardware configuration. + /// + /// + /// GPU accelerator model, such as `H100` or `B200`. + /// + /// + /// Number of GPUs in one replica of this instance type. + /// + /// + /// Memory available on each GPU, in GiB. + /// + /// + /// On-demand price for one running replica, in US cents per hour. + /// + /// + /// Regions where this instance type is offered. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeInferenceInstanceType( + string id, + string name, + string description, + string gpuType, + int gpuCount, + int gpuMemoryGib, + int priceCentsPerHour, + global::System.Collections.Generic.IList regions) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); + this.GpuType = gpuType ?? throw new global::System.ArgumentNullException(nameof(gpuType)); + this.GpuCount = gpuCount; + this.GpuMemoryGib = gpuMemoryGib; + this.PriceCentsPerHour = priceCentsPerHour; + this.Regions = regions ?? throw new global::System.ArgumentNullException(nameof(regions)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeInferenceInstanceType() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeInlinePlacement.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeInlinePlacement.Json.g.cs new file mode 100644 index 00000000..5a4efce5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeInlinePlacement.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeInlinePlacement + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeInlinePlacement? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeInlinePlacement), + jsonSerializerContext) as global::Together.DeInlinePlacement; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeInlinePlacement? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeInlinePlacement? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeInlinePlacement), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeInlinePlacement; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeInlinePlacement.g.cs b/src/libs/Together/Generated/Together.Models.DeInlinePlacement.g.cs new file mode 100644 index 00000000..75702158 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeInlinePlacement.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Inline placement parameters expanded into scheduling rules by the server. + /// + public sealed partial class DeInlinePlacement + { + /// + /// Regions where the deployment is allowed to run. Multiple regions allow best-effort replica spreading. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("regions")] + public global::System.Collections.Generic.IList? Regions { get; set; } + + /// + /// How strictly the regions list is enforced. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("constraint")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter))] + public global::Together.DeInlinePlacementConstraint? Constraint { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Regions where the deployment is allowed to run. Multiple regions allow best-effort replica spreading. + /// + /// + /// How strictly the regions list is enforced. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeInlinePlacement( + global::System.Collections.Generic.IList? regions, + global::Together.DeInlinePlacementConstraint? constraint) + { + this.Regions = regions; + this.Constraint = constraint; + } + + /// + /// Initializes a new instance of the class. + /// + public DeInlinePlacement() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeInlinePlacementConstraint.g.cs b/src/libs/Together/Generated/Together.Models.DeInlinePlacementConstraint.g.cs new file mode 100644 index 00000000..ff3f07cc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeInlinePlacementConstraint.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// How strictly the regions list is enforced. + /// + public enum DeInlinePlacementConstraint + { + /// + /// + /// + EnforcementPreferred, + /// + /// + /// + EnforcementRequired, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeInlinePlacementConstraintExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeInlinePlacementConstraint value) + { + return value switch + { + DeInlinePlacementConstraint.EnforcementPreferred => "ENFORCEMENT_PREFERRED", + DeInlinePlacementConstraint.EnforcementRequired => "ENFORCEMENT_REQUIRED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeInlinePlacementConstraint? ToEnum(string value) + { + return value switch + { + "ENFORCEMENT_PREFERRED" => DeInlinePlacementConstraint.EnforcementPreferred, + "ENFORCEMENT_REQUIRED" => DeInlinePlacementConstraint.EnforcementRequired, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.Json.g.cs new file mode 100644 index 00000000..6b9bce15 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeLatencyMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeLatencyMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeLatencyMetrics), + jsonSerializerContext) as global::Together.DeLatencyMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeLatencyMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeLatencyMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeLatencyMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeLatencyMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.g.cs new file mode 100644 index 00000000..51c90f96 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeLatencyMetrics.g.cs @@ -0,0 +1,134 @@ + +#nullable enable + +namespace Together +{ + /// + /// Time-to-first-token, end-to-end, and inter-token latency percentiles in milliseconds. + /// + public sealed partial class DeLatencyMetrics + { + /// + /// 50th-percentile time to first token, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ttftP50Ms")] + public double? TtftP50Ms { get; set; } + + /// + /// 90th-percentile time to first token, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ttftP90Ms")] + public double? TtftP90Ms { get; set; } + + /// + /// 99th-percentile time to first token, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ttftP99Ms")] + public double? TtftP99Ms { get; set; } + + /// + /// 50th-percentile end-to-end request latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latencyP50Ms")] + public double? LatencyP50Ms { get; set; } + + /// + /// 90th-percentile end-to-end request latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latencyP90Ms")] + public double? LatencyP90Ms { get; set; } + + /// + /// 99th-percentile end-to-end request latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("latencyP99Ms")] + public double? LatencyP99Ms { get; set; } + + /// + /// 50th-percentile inter-token latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("itlP50Ms")] + public double? ItlP50Ms { get; set; } + + /// + /// 90th-percentile inter-token latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("itlP90Ms")] + public double? ItlP90Ms { get; set; } + + /// + /// 99th-percentile inter-token latency, in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("itlP99Ms")] + public double? ItlP99Ms { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// 50th-percentile time to first token, in milliseconds. + /// + /// + /// 90th-percentile time to first token, in milliseconds. + /// + /// + /// 99th-percentile time to first token, in milliseconds. + /// + /// + /// 50th-percentile end-to-end request latency, in milliseconds. + /// + /// + /// 90th-percentile end-to-end request latency, in milliseconds. + /// + /// + /// 99th-percentile end-to-end request latency, in milliseconds. + /// + /// + /// 50th-percentile inter-token latency, in milliseconds. + /// + /// + /// 90th-percentile inter-token latency, in milliseconds. + /// + /// + /// 99th-percentile inter-token latency, in milliseconds. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeLatencyMetrics( + double? ttftP50Ms, + double? ttftP90Ms, + double? ttftP99Ms, + double? latencyP50Ms, + double? latencyP90Ms, + double? latencyP99Ms, + double? itlP50Ms, + double? itlP90Ms, + double? itlP99Ms) + { + this.TtftP50Ms = ttftP50Ms; + this.TtftP90Ms = ttftP90Ms; + this.TtftP99Ms = ttftP99Ms; + this.LatencyP50Ms = latencyP50Ms; + this.LatencyP90Ms = latencyP90Ms; + this.LatencyP99Ms = latencyP99Ms; + this.ItlP50Ms = itlP50Ms; + this.ItlP90Ms = itlP90Ms; + this.ItlP99Ms = itlP99Ms; + } + + /// + /// Initializes a new instance of the class. + /// + public DeLatencyMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.Json.g.cs new file mode 100644 index 00000000..f08c171a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListABExperimentsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListABExperimentsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListABExperimentsResponse), + jsonSerializerContext) as global::Together.DeListABExperimentsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListABExperimentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListABExperimentsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListABExperimentsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListABExperimentsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.g.cs new file mode 100644 index 00000000..e466b849 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Managed A/B traffic experiments under an endpoint. + /// + public sealed partial class DeListABExperimentsResponse + { + /// + /// A/B experiments under the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A/B experiments under the endpoint. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListABExperimentsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListABExperimentsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.Json.g.cs new file mode 100644 index 00000000..7959806c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListABExperimentsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListABExperimentsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListABExperimentsResponseObject), + jsonSerializerContext) as global::Together.DeListABExperimentsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListABExperimentsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListABExperimentsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListABExperimentsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListABExperimentsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.g.cs new file mode 100644 index 00000000..854a2741 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListABExperimentsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListABExperimentsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.Json.g.cs new file mode 100644 index 00000000..7d9349fc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListAdaptersResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListAdaptersResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListAdaptersResponse), + jsonSerializerContext) as global::Together.DeListAdaptersResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListAdaptersResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListAdaptersResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListAdaptersResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListAdaptersResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.g.cs new file mode 100644 index 00000000..6841de04 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing attached adapters and pagination metadata. + /// + public sealed partial class DeListAdaptersResponse + { + /// + /// Adapters attached to the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adapters attached to the deployment. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListAdaptersResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListAdaptersResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.Json.g.cs new file mode 100644 index 00000000..d89a75fa --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListAdaptersResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListAdaptersResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListAdaptersResponseObject), + jsonSerializerContext) as global::Together.DeListAdaptersResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListAdaptersResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListAdaptersResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListAdaptersResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListAdaptersResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.g.cs new file mode 100644 index 00000000..49f0b258 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListAdaptersResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListAdaptersResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.Json.g.cs new file mode 100644 index 00000000..4f73ea58 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListDeploymentsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListDeploymentsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListDeploymentsResponse), + jsonSerializerContext) as global::Together.DeListDeploymentsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListDeploymentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListDeploymentsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListDeploymentsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListDeploymentsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.g.cs new file mode 100644 index 00000000..12af5421 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Deployments under an endpoint and pagination metadata. + /// + public sealed partial class DeListDeploymentsResponse + { + /// + /// The list of deployments. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of deployments. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListDeploymentsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListDeploymentsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.Json.g.cs new file mode 100644 index 00000000..d1e86a7e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListDeploymentsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListDeploymentsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListDeploymentsResponseObject), + jsonSerializerContext) as global::Together.DeListDeploymentsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListDeploymentsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListDeploymentsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListDeploymentsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListDeploymentsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.g.cs new file mode 100644 index 00000000..0d78129c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListDeploymentsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListDeploymentsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.Json.g.cs new file mode 100644 index 00000000..542131b1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListEndpointAccessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListEndpointAccessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListEndpointAccessResponse), + jsonSerializerContext) as global::Together.DeListEndpointAccessResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListEndpointAccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListEndpointAccessResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListEndpointAccessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListEndpointAccessResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.g.cs new file mode 100644 index 00000000..085b3cd9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointAccessResponse.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Principals currently allowed to send inference requests to an endpoint. + /// + public sealed partial class DeListEndpointAccessResponse + { + /// + /// All principals currently granted access on the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("entries")] + public global::System.Collections.Generic.IList? Entries { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// All principals currently granted access on the endpoint. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListEndpointAccessResponse( + global::System.Collections.Generic.IList? entries) + { + this.Entries = entries; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListEndpointAccessResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.Json.g.cs new file mode 100644 index 00000000..a817a2d4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListEndpointEventsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListEndpointEventsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListEndpointEventsResponse), + jsonSerializerContext) as global::Together.DeListEndpointEventsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListEndpointEventsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListEndpointEventsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListEndpointEventsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListEndpointEventsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.g.cs new file mode 100644 index 00000000..b223ab5f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint and deployment lifecycle events, ordered newest first. + /// + public sealed partial class DeListEndpointEventsResponse + { + /// + /// Events for the endpoint, newest first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Events for the endpoint, newest first. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListEndpointEventsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListEndpointEventsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.Json.g.cs new file mode 100644 index 00000000..13ac1c6a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListEndpointEventsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListEndpointEventsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListEndpointEventsResponseObject), + jsonSerializerContext) as global::Together.DeListEndpointEventsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListEndpointEventsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListEndpointEventsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListEndpointEventsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListEndpointEventsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.g.cs new file mode 100644 index 00000000..b77c1a68 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointEventsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListEndpointEventsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.Json.g.cs new file mode 100644 index 00000000..e5b6162e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListEndpointsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListEndpointsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListEndpointsResponse), + jsonSerializerContext) as global::Together.DeListEndpointsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListEndpointsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListEndpointsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListEndpointsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListEndpointsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.g.cs new file mode 100644 index 00000000..cac7fe8e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing endpoints and pagination metadata. + /// + public sealed partial class DeListEndpointsResponse + { + /// + /// The list of endpoints. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of endpoints. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListEndpointsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListEndpointsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.Json.g.cs new file mode 100644 index 00000000..3c96826c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListEndpointsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListEndpointsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListEndpointsResponseObject), + jsonSerializerContext) as global::Together.DeListEndpointsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListEndpointsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListEndpointsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListEndpointsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListEndpointsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.g.cs new file mode 100644 index 00000000..917ff2d5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListEndpointsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListEndpointsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponse.Json.g.cs new file mode 100644 index 00000000..fc7342e3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListFilesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListFilesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListFilesResponse), + jsonSerializerContext) as global::Together.DeListFilesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListFilesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListFilesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListFilesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListFilesResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponse.g.cs new file mode 100644 index 00000000..f575c199 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponse.g.cs @@ -0,0 +1,101 @@ + +#nullable enable + +namespace Together +{ + /// + /// Files and aggregate size information for one model revision. + /// + public sealed partial class DeListFilesResponse + { + /// + /// Files in the selected model revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// ID of the model revision whose files are listed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("revisionId")] + public string? RevisionId { get; set; } + + /// + /// Time when the listed model revision was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("revisionCreatedAt")] + public global::System.DateTime? RevisionCreatedAt { get; set; } + + /// + /// Total size of all files in the revision, in bytes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalSizeBytes")] + public string? TotalSizeBytes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Files in the selected model revision. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// ID of the model revision whose files are listed. + /// + /// + /// Time when the listed model revision was created. + /// + /// + /// Total size of all files in the revision, in bytes. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListFilesResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string? revisionId, + global::System.DateTime? revisionCreatedAt, + string? totalSizeBytes, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + this.RevisionId = revisionId; + this.RevisionCreatedAt = revisionCreatedAt; + this.TotalSizeBytes = totalSizeBytes; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListFilesResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.Json.g.cs new file mode 100644 index 00000000..cd28c8c5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListFilesResponseFile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListFilesResponseFile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListFilesResponseFile), + jsonSerializerContext) as global::Together.DeListFilesResponseFile; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListFilesResponseFile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListFilesResponseFile? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListFilesResponseFile), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListFilesResponseFile; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.g.cs new file mode 100644 index 00000000..20c70d16 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponseFile.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Metadata for one file in a model revision. + /// + public sealed partial class DeListFilesResponseFile + { + /// + /// File path within the model revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Content hash for integrity verification and upload deduplication. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// + /// File size in bytes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sizeBytes")] + public string? SizeBytes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// File path within the model revision. + /// + /// + /// Content hash for integrity verification and upload deduplication. + /// + /// + /// File size in bytes. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListFilesResponseFile( + string? path, + string? hash, + string? sizeBytes) + { + this.Path = path; + this.Hash = hash; + this.SizeBytes = sizeBytes; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListFilesResponseFile() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.Json.g.cs new file mode 100644 index 00000000..dc06788e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListFilesResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListFilesResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListFilesResponseObject), + jsonSerializerContext) as global::Together.DeListFilesResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListFilesResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListFilesResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListFilesResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListFilesResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.g.cs new file mode 100644 index 00000000..b59627d5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListFilesResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeListFilesResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.Json.g.cs new file mode 100644 index 00000000..95b9e7f6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListInferenceInstanceTypesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListInferenceInstanceTypesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListInferenceInstanceTypesResponse), + jsonSerializerContext) as global::Together.DeListInferenceInstanceTypesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListInferenceInstanceTypesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListInferenceInstanceTypesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListInferenceInstanceTypesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListInferenceInstanceTypesResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.g.cs new file mode 100644 index 00000000..4dcb72ad --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Hardware instance types available for inference deployments. + /// + public sealed partial class DeListInferenceInstanceTypesResponse + { + /// + /// Instance types available for inference. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Always null today because this catalog is returned in full. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Instance types available for inference. + /// + /// + /// Cursor for the next page. Always null today because this catalog is returned in full. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListInferenceInstanceTypesResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListInferenceInstanceTypesResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.Json.g.cs new file mode 100644 index 00000000..9d1e8897 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListInferenceInstanceTypesResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListInferenceInstanceTypesResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListInferenceInstanceTypesResponseObject), + jsonSerializerContext) as global::Together.DeListInferenceInstanceTypesResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListInferenceInstanceTypesResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListInferenceInstanceTypesResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListInferenceInstanceTypesResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListInferenceInstanceTypesResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.g.cs new file mode 100644 index 00000000..7234f481 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListInferenceInstanceTypesResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListInferenceInstanceTypesResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListModelsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListModelsResponse.Json.g.cs new file mode 100644 index 00000000..e2a67e66 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListModelsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListModelsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListModelsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListModelsResponse), + jsonSerializerContext) as global::Together.DeListModelsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListModelsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListModelsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListModelsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListModelsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListModelsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListModelsResponse.g.cs new file mode 100644 index 00000000..a9c39cb3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListModelsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Custom model resources and pagination metadata. + /// + public sealed partial class DeListModelsResponse + { + /// + /// The list of models. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of models. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListModelsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListModelsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.Json.g.cs new file mode 100644 index 00000000..8b453918 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListModelsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListModelsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListModelsResponseObject), + jsonSerializerContext) as global::Together.DeListModelsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListModelsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListModelsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListModelsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListModelsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.g.cs new file mode 100644 index 00000000..6ccadfd3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListModelsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListModelsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.Json.g.cs new file mode 100644 index 00000000..3d3a47f3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListPlacementProfilesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListPlacementProfilesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListPlacementProfilesResponse), + jsonSerializerContext) as global::Together.DeListPlacementProfilesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListPlacementProfilesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListPlacementProfilesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListPlacementProfilesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListPlacementProfilesResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.g.cs new file mode 100644 index 00000000..d2ebb583 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Reusable deployment placement profiles visible to the project. + /// + public sealed partial class DeListPlacementProfilesResponse + { + /// + /// Placement profiles visible in the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Placement profiles visible in the project. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListPlacementProfilesResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListPlacementProfilesResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.Json.g.cs new file mode 100644 index 00000000..04f3627b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListPlacementProfilesResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListPlacementProfilesResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListPlacementProfilesResponseObject), + jsonSerializerContext) as global::Together.DeListPlacementProfilesResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListPlacementProfilesResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListPlacementProfilesResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListPlacementProfilesResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListPlacementProfilesResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.g.cs new file mode 100644 index 00000000..4e82ef93 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPlacementProfilesResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListPlacementProfilesResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.Json.g.cs new file mode 100644 index 00000000..876113c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListProjectConfigsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListProjectConfigsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListProjectConfigsResponse), + jsonSerializerContext) as global::Together.DeListProjectConfigsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListProjectConfigsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListProjectConfigsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListProjectConfigsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListProjectConfigsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.g.cs new file mode 100644 index 00000000..8fc3d707 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Model-compatible config revisions and pagination metadata. + /// + public sealed partial class DeListProjectConfigsResponse + { + /// + /// The list of model configs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The list of model configs. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListProjectConfigsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListProjectConfigsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.Json.g.cs new file mode 100644 index 00000000..ccdc7acc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListProjectConfigsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListProjectConfigsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListProjectConfigsResponseObject), + jsonSerializerContext) as global::Together.DeListProjectConfigsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListProjectConfigsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListProjectConfigsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListProjectConfigsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListProjectConfigsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.g.cs new file mode 100644 index 00000000..c6d6996b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListProjectConfigsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListProjectConfigsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.Json.g.cs new file mode 100644 index 00000000..c2384721 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListPublicEndpointsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListPublicEndpointsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListPublicEndpointsResponse), + jsonSerializerContext) as global::Together.DeListPublicEndpointsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListPublicEndpointsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListPublicEndpointsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListPublicEndpointsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListPublicEndpointsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.g.cs new file mode 100644 index 00000000..c766829b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing publicly discoverable endpoints and pagination metadata. + /// + public sealed partial class DeListPublicEndpointsResponse + { + /// + /// Endpoints visible through the public catalog. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Endpoints visible through the public catalog. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListPublicEndpointsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListPublicEndpointsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.Json.g.cs new file mode 100644 index 00000000..49c788de --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListPublicEndpointsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListPublicEndpointsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListPublicEndpointsResponseObject), + jsonSerializerContext) as global::Together.DeListPublicEndpointsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListPublicEndpointsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListPublicEndpointsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListPublicEndpointsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListPublicEndpointsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.g.cs new file mode 100644 index 00000000..fda7aaa1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListPublicEndpointsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListPublicEndpointsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.Json.g.cs new file mode 100644 index 00000000..76782bbf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRemoteUploadEventsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadEventsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRemoteUploadEventsResponse), + jsonSerializerContext) as global::Together.DeListRemoteUploadEventsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadEventsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRemoteUploadEventsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRemoteUploadEventsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRemoteUploadEventsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.g.cs new file mode 100644 index 00000000..8297ead3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Status and diagnostic events for a remote model import job. + /// + public sealed partial class DeListRemoteUploadEventsResponse + { + /// + /// Events for the remote upload. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Events for the remote upload. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListRemoteUploadEventsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListRemoteUploadEventsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.Json.g.cs new file mode 100644 index 00000000..ff939765 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRemoteUploadEventsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadEventsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRemoteUploadEventsResponseObject), + jsonSerializerContext) as global::Together.DeListRemoteUploadEventsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadEventsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRemoteUploadEventsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRemoteUploadEventsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRemoteUploadEventsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.g.cs new file mode 100644 index 00000000..df743cd3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadEventsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListRemoteUploadEventsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.Json.g.cs new file mode 100644 index 00000000..3c960e56 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRemoteUploadsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRemoteUploadsResponse), + jsonSerializerContext) as global::Together.DeListRemoteUploadsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRemoteUploadsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRemoteUploadsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRemoteUploadsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.g.cs new file mode 100644 index 00000000..5f1819ea --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Remote model import jobs and pagination metadata. + /// + public sealed partial class DeListRemoteUploadsResponse + { + /// + /// Remote upload jobs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Remote upload jobs. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListRemoteUploadsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListRemoteUploadsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.Json.g.cs new file mode 100644 index 00000000..4179aba5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRemoteUploadsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRemoteUploadsResponseObject), + jsonSerializerContext) as global::Together.DeListRemoteUploadsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRemoteUploadsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRemoteUploadsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRemoteUploadsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRemoteUploadsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.g.cs new file mode 100644 index 00000000..bbe28337 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRemoteUploadsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListRemoteUploadsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.Json.g.cs new file mode 100644 index 00000000..37a44679 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRevisionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRevisionsResponse), + jsonSerializerContext) as global::Together.DeListRevisionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRevisionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRevisionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRevisionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.g.cs new file mode 100644 index 00000000..3eafd391 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponse.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Immutable model revisions and pagination metadata. + /// + public sealed partial class DeListRevisionsResponse + { + /// + /// Immutable revisions available for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::System.Collections.Generic.IList? Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Immutable revisions available for the model. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListRevisionsResponse( + global::System.Collections.Generic.IList? data, + string? nextCursor, + string? @object) + { + this.Data = data; + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListRevisionsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.Json.g.cs new file mode 100644 index 00000000..1182a499 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRevisionsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRevisionsResponseObject), + jsonSerializerContext) as global::Together.DeListRevisionsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRevisionsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRevisionsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRevisionsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.g.cs new file mode 100644 index 00000000..22eb8be8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListRevisionsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.Json.g.cs new file mode 100644 index 00000000..3b8d8fc4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRevisionsResponseRevision + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponseRevision? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRevisionsResponseRevision), + jsonSerializerContext) as global::Together.DeListRevisionsResponseRevision; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRevisionsResponseRevision? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRevisionsResponseRevision? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRevisionsResponseRevision), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRevisionsResponseRevision; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.g.cs new file mode 100644 index 00000000..f07a954a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevision.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Together +{ + /// + /// Revision metadata for a volume object. + /// + public sealed partial class DeListRevisionsResponseRevision + { + /// + /// Revision identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("revisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RevisionId { get; set; } + + /// + /// Timestamp when the revision was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Current validation status for the revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("validationStatus")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter))] + public global::Together.DeListRevisionsResponseRevisionValidationStatus? ValidationStatus { get; set; } + + /// + /// Timestamp when validation most recently ran for the revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("lastValidatedAt")] + public global::System.DateTime? LastValidatedAt { get; set; } + + /// + /// Validation errors reported for the revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("validationErrors")] + public global::System.Collections.Generic.IList? ValidationErrors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Revision identifier. + /// + /// + /// Timestamp when the revision was created. + /// + /// + /// Current validation status for the revision. + /// + /// + /// Timestamp when validation most recently ran for the revision. + /// + /// + /// Validation errors reported for the revision. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListRevisionsResponseRevision( + string revisionId, + global::System.DateTime createdAt, + global::Together.DeListRevisionsResponseRevisionValidationStatus? validationStatus, + global::System.DateTime? lastValidatedAt, + global::System.Collections.Generic.IList? validationErrors) + { + this.RevisionId = revisionId ?? throw new global::System.ArgumentNullException(nameof(revisionId)); + this.CreatedAt = createdAt; + this.ValidationStatus = validationStatus; + this.LastValidatedAt = lastValidatedAt; + this.ValidationErrors = validationErrors; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListRevisionsResponseRevision() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevisionValidationStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevisionValidationStatus.g.cs new file mode 100644 index 00000000..abf98c3c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRevisionsResponseRevisionValidationStatus.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current validation status for the revision. + /// + public enum DeListRevisionsResponseRevisionValidationStatus + { + /// + /// + /// + RevisionValidationStatusError, + /// + /// + /// + RevisionValidationStatusFailed, + /// + /// + /// + RevisionValidationStatusPending, + /// + /// + /// + RevisionValidationStatusSuccess, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeListRevisionsResponseRevisionValidationStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeListRevisionsResponseRevisionValidationStatus value) + { + return value switch + { + DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusError => "REVISION_VALIDATION_STATUS_ERROR", + DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusFailed => "REVISION_VALIDATION_STATUS_FAILED", + DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusPending => "REVISION_VALIDATION_STATUS_PENDING", + DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusSuccess => "REVISION_VALIDATION_STATUS_SUCCESS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeListRevisionsResponseRevisionValidationStatus? ToEnum(string value) + { + return value switch + { + "REVISION_VALIDATION_STATUS_ERROR" => DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusError, + "REVISION_VALIDATION_STATUS_FAILED" => DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusFailed, + "REVISION_VALIDATION_STATUS_PENDING" => DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusPending, + "REVISION_VALIDATION_STATUS_SUCCESS" => DeListRevisionsResponseRevisionValidationStatus.RevisionValidationStatusSuccess, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.Json.g.cs new file mode 100644 index 00000000..15a02aef --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRolloutsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRolloutsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRolloutsResponse), + jsonSerializerContext) as global::Together.DeListRolloutsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRolloutsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRolloutsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRolloutsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRolloutsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.g.cs new file mode 100644 index 00000000..1fb70cc7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing rollout resources and pagination metadata. + /// + public sealed partial class DeListRolloutsResponse + { + /// + /// Rollouts under the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Rollouts under the endpoint. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListRolloutsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListRolloutsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.Json.g.cs new file mode 100644 index 00000000..265633c3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListRolloutsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListRolloutsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListRolloutsResponseObject), + jsonSerializerContext) as global::Together.DeListRolloutsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListRolloutsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListRolloutsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListRolloutsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListRolloutsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.g.cs new file mode 100644 index 00000000..d5c2b816 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListRolloutsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListRolloutsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.Json.g.cs new file mode 100644 index 00000000..718b7d78 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListShadowExperimentTargetsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentTargetsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListShadowExperimentTargetsResponse), + jsonSerializerContext) as global::Together.DeListShadowExperimentTargetsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentTargetsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListShadowExperimentTargetsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListShadowExperimentTargetsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListShadowExperimentTargetsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.g.cs new file mode 100644 index 00000000..9baa00d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing shadow experiment targets and pagination metadata. + /// + public sealed partial class DeListShadowExperimentTargetsResponse + { + /// + /// Target deployments under the shadow experiment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Target deployments under the shadow experiment. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListShadowExperimentTargetsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListShadowExperimentTargetsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.Json.g.cs new file mode 100644 index 00000000..0bce874f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListShadowExperimentTargetsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentTargetsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListShadowExperimentTargetsResponseObject), + jsonSerializerContext) as global::Together.DeListShadowExperimentTargetsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentTargetsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListShadowExperimentTargetsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListShadowExperimentTargetsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListShadowExperimentTargetsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.g.cs new file mode 100644 index 00000000..f3ebb63a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentTargetsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListShadowExperimentTargetsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.Json.g.cs new file mode 100644 index 00000000..9a27e4b1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListShadowExperimentsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListShadowExperimentsResponse), + jsonSerializerContext) as global::Together.DeListShadowExperimentsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListShadowExperimentsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListShadowExperimentsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListShadowExperimentsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.g.cs new file mode 100644 index 00000000..3b55e7a0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing shadow experiments and pagination metadata. + /// + public sealed partial class DeListShadowExperimentsResponse + { + /// + /// Shadow experiments under the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Shadow experiments under the endpoint. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListShadowExperimentsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListShadowExperimentsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.Json.g.cs new file mode 100644 index 00000000..dcb774bc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListShadowExperimentsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListShadowExperimentsResponseObject), + jsonSerializerContext) as global::Together.DeListShadowExperimentsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListShadowExperimentsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListShadowExperimentsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListShadowExperimentsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListShadowExperimentsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.g.cs new file mode 100644 index 00000000..0e8df5b4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListShadowExperimentsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListShadowExperimentsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.Json.g.cs new file mode 100644 index 00000000..b641ec15 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListSupportedModelsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListSupportedModelsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListSupportedModelsResponse), + jsonSerializerContext) as global::Together.DeListSupportedModelsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListSupportedModelsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListSupportedModelsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListSupportedModelsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListSupportedModelsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.g.cs new file mode 100644 index 00000000..941bcad5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response containing supported models and pagination metadata. + /// + public sealed partial class DeListSupportedModelsResponse + { + /// + /// Supported models in the catalog. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Cursor for the next page. Null if there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Object type. Always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Supported models in the catalog. + /// + /// + /// Cursor for the next page. Null if there are no more results. + /// + /// + /// Object type. Always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeListSupportedModelsResponse( + global::System.Collections.Generic.IList data, + string? nextCursor, + string @object = "list") + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextCursor = nextCursor; + this.Object = @object; + } + + /// + /// Initializes a new instance of the class. + /// + public DeListSupportedModelsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.Json.g.cs new file mode 100644 index 00000000..d7f44ff5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeListSupportedModelsResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeListSupportedModelsResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeListSupportedModelsResponseObject), + jsonSerializerContext) as global::Together.DeListSupportedModelsResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeListSupportedModelsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeListSupportedModelsResponseObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeListSupportedModelsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeListSupportedModelsResponseObject; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.g.cs new file mode 100644 index 00000000..97874694 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeListSupportedModelsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Object type. Always `list`. + /// + public sealed partial class DeListSupportedModelsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResult.Json.g.cs new file mode 100644 index 00000000..6ae404ad --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeMetricResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeMetricResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeMetricResult), + jsonSerializerContext) as global::Together.DeMetricResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeMetricResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeMetricResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeMetricResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeMetricResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResult.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResult.g.cs new file mode 100644 index 00000000..74ff5a4a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResult.g.cs @@ -0,0 +1,161 @@ + +#nullable enable + +namespace Together +{ + /// + /// Observed metric value enriched with its rollout rule and verdict. + /// + public sealed partial class DeMetricResult + { + /// + /// Metric name as exported to the observability backend. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Aggregation used for the metric. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stat")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricResultStatJsonConverter))] + public global::Together.DeMetricResultStat? Stat { get; set; } + + /// + /// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("percentile")] + public int? Percentile { get; set; } + + /// + /// Evaluation form used by the metric rule. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("check")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricResultCheckJsonConverter))] + public global::Together.DeMetricResultCheck? Check { get; set; } + + /// + /// Observed source baseline. Set only for regression checks; a 0 reading serializes explicitly. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sourceValue")] + public double? SourceValue { get; set; } + + /// + /// Observed target value. A 0 reading serializes explicitly. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetValue")] + public double? TargetValue { get; set; } + + /// + /// Threshold criteria used when check is METRIC_CHECK_TYPE_THRESHOLD. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + + /// + /// Threshold comparison operator. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("operator")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricResultOperatorJsonConverter))] + public global::Together.DeMetricResultOperator? Operator { get; set; } + + /// + /// Regression percentage limit used when check is METRIC_CHECK_TYPE_REGRESSION. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxRegressionPercent")] + public double? MaxRegressionPercent { get; set; } + + /// + /// Direction that indicates whether higher or lower values are worse. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("direction")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricResultDirectionJsonConverter))] + public global::Together.DeMetricResultDirection? Direction { get; set; } + + /// + /// Result of evaluating this metric at the gate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("verdict")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricResultVerdictJsonConverter))] + public global::Together.DeMetricResultVerdict? Verdict { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Metric name as exported to the observability backend. + /// + /// + /// Aggregation used for the metric. + /// + /// + /// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + /// + /// + /// Evaluation form used by the metric rule. + /// + /// + /// Observed source baseline. Set only for regression checks; a 0 reading serializes explicitly. + /// + /// + /// Observed target value. A 0 reading serializes explicitly. + /// + /// + /// Threshold criteria used when check is METRIC_CHECK_TYPE_THRESHOLD. + /// + /// + /// Threshold comparison operator. + /// + /// + /// Regression percentage limit used when check is METRIC_CHECK_TYPE_REGRESSION. + /// + /// + /// Direction that indicates whether higher or lower values are worse. + /// + /// + /// Result of evaluating this metric at the gate. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeMetricResult( + string? name, + global::Together.DeMetricResultStat? stat, + int? percentile, + global::Together.DeMetricResultCheck? check, + double? sourceValue, + double? targetValue, + double? threshold, + global::Together.DeMetricResultOperator? @operator, + double? maxRegressionPercent, + global::Together.DeMetricResultDirection? direction, + global::Together.DeMetricResultVerdict? verdict) + { + this.Name = name; + this.Stat = stat; + this.Percentile = percentile; + this.Check = check; + this.SourceValue = sourceValue; + this.TargetValue = targetValue; + this.Threshold = threshold; + this.Operator = @operator; + this.MaxRegressionPercent = maxRegressionPercent; + this.Direction = direction; + this.Verdict = verdict; + } + + /// + /// Initializes a new instance of the class. + /// + public DeMetricResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResultCheck.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResultCheck.g.cs new file mode 100644 index 00000000..b7523513 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResultCheck.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Evaluation form used by the metric rule. + /// + public enum DeMetricResultCheck + { + /// + /// + /// + MetricCheckTypeRegression, + /// + /// + /// + MetricCheckTypeThreshold, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricResultCheckExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricResultCheck value) + { + return value switch + { + DeMetricResultCheck.MetricCheckTypeRegression => "METRIC_CHECK_TYPE_REGRESSION", + DeMetricResultCheck.MetricCheckTypeThreshold => "METRIC_CHECK_TYPE_THRESHOLD", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricResultCheck? ToEnum(string value) + { + return value switch + { + "METRIC_CHECK_TYPE_REGRESSION" => DeMetricResultCheck.MetricCheckTypeRegression, + "METRIC_CHECK_TYPE_THRESHOLD" => DeMetricResultCheck.MetricCheckTypeThreshold, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResultDirection.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResultDirection.g.cs new file mode 100644 index 00000000..a6a7f2e5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResultDirection.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Direction that indicates whether higher or lower values are worse. + /// + public enum DeMetricResultDirection + { + /// + /// + /// + RegressionDirectionHigherIsWorse, + /// + /// + /// + RegressionDirectionLowerIsWorse, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricResultDirectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricResultDirection value) + { + return value switch + { + DeMetricResultDirection.RegressionDirectionHigherIsWorse => "REGRESSION_DIRECTION_HIGHER_IS_WORSE", + DeMetricResultDirection.RegressionDirectionLowerIsWorse => "REGRESSION_DIRECTION_LOWER_IS_WORSE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricResultDirection? ToEnum(string value) + { + return value switch + { + "REGRESSION_DIRECTION_HIGHER_IS_WORSE" => DeMetricResultDirection.RegressionDirectionHigherIsWorse, + "REGRESSION_DIRECTION_LOWER_IS_WORSE" => DeMetricResultDirection.RegressionDirectionLowerIsWorse, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResultOperator.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResultOperator.g.cs new file mode 100644 index 00000000..385b76cc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResultOperator.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Threshold comparison operator. + /// + public enum DeMetricResultOperator + { + /// + /// + /// + ThresholdOperatorGt, + /// + /// + /// + ThresholdOperatorGte, + /// + /// + /// + ThresholdOperatorLt, + /// + /// + /// + ThresholdOperatorLte, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricResultOperatorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricResultOperator value) + { + return value switch + { + DeMetricResultOperator.ThresholdOperatorGt => "THRESHOLD_OPERATOR_GT", + DeMetricResultOperator.ThresholdOperatorGte => "THRESHOLD_OPERATOR_GTE", + DeMetricResultOperator.ThresholdOperatorLt => "THRESHOLD_OPERATOR_LT", + DeMetricResultOperator.ThresholdOperatorLte => "THRESHOLD_OPERATOR_LTE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricResultOperator? ToEnum(string value) + { + return value switch + { + "THRESHOLD_OPERATOR_GT" => DeMetricResultOperator.ThresholdOperatorGt, + "THRESHOLD_OPERATOR_GTE" => DeMetricResultOperator.ThresholdOperatorGte, + "THRESHOLD_OPERATOR_LT" => DeMetricResultOperator.ThresholdOperatorLt, + "THRESHOLD_OPERATOR_LTE" => DeMetricResultOperator.ThresholdOperatorLte, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResultStat.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResultStat.g.cs new file mode 100644 index 00000000..39257675 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResultStat.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Aggregation used for the metric. + /// + public enum DeMetricResultStat + { + /// + /// + /// + MetricStatTypeAvg, + /// + /// + /// + MetricStatTypeMax, + /// + /// + /// + MetricStatTypeMin, + /// + /// + /// + MetricStatTypePercentile, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricResultStatExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricResultStat value) + { + return value switch + { + DeMetricResultStat.MetricStatTypeAvg => "METRIC_STAT_TYPE_AVG", + DeMetricResultStat.MetricStatTypeMax => "METRIC_STAT_TYPE_MAX", + DeMetricResultStat.MetricStatTypeMin => "METRIC_STAT_TYPE_MIN", + DeMetricResultStat.MetricStatTypePercentile => "METRIC_STAT_TYPE_PERCENTILE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricResultStat? ToEnum(string value) + { + return value switch + { + "METRIC_STAT_TYPE_AVG" => DeMetricResultStat.MetricStatTypeAvg, + "METRIC_STAT_TYPE_MAX" => DeMetricResultStat.MetricStatTypeMax, + "METRIC_STAT_TYPE_MIN" => DeMetricResultStat.MetricStatTypeMin, + "METRIC_STAT_TYPE_PERCENTILE" => DeMetricResultStat.MetricStatTypePercentile, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricResultVerdict.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricResultVerdict.g.cs new file mode 100644 index 00000000..5c16c066 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricResultVerdict.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Result of evaluating this metric at the gate. + /// + public enum DeMetricResultVerdict + { + /// + /// + /// + MetricVerdictBreached, + /// + /// + /// + MetricVerdictPass, + /// + /// + /// + MetricVerdictUnavailable, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricResultVerdictExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricResultVerdict value) + { + return value switch + { + DeMetricResultVerdict.MetricVerdictBreached => "METRIC_VERDICT_BREACHED", + DeMetricResultVerdict.MetricVerdictPass => "METRIC_VERDICT_PASS", + DeMetricResultVerdict.MetricVerdictUnavailable => "METRIC_VERDICT_UNAVAILABLE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricResultVerdict? ToEnum(string value) + { + return value switch + { + "METRIC_VERDICT_BREACHED" => DeMetricResultVerdict.MetricVerdictBreached, + "METRIC_VERDICT_PASS" => DeMetricResultVerdict.MetricVerdictPass, + "METRIC_VERDICT_UNAVAILABLE" => DeMetricResultVerdict.MetricVerdictUnavailable, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRule.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRule.Json.g.cs new file mode 100644 index 00000000..2186c512 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRule.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeMetricRule + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeMetricRule? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeMetricRule), + jsonSerializerContext) as global::Together.DeMetricRule; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeMetricRule? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeMetricRule? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeMetricRule), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeMetricRule; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRule.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRule.g.cs new file mode 100644 index 00000000..9edf2063 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRule.g.cs @@ -0,0 +1,104 @@ + +#nullable enable + +namespace Together +{ + /// + /// Metric gate evaluated during a rollout. + /// + public sealed partial class DeMetricRule + { + /// + /// Required metric name as exported to the observability backend. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Required aggregation used for the metric. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stat")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeMetricRuleStatJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeMetricRuleStat Stat { get; set; } + + /// + /// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("percentile")] + public int? Percentile { get; set; } + + /// + /// Threshold evaluation criteria. Mutually exclusive with regressionCheck. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("thresholdCheck")] + public global::Together.DeThresholdCheck? ThresholdCheck { get; set; } + + /// + /// Regression evaluation criteria. Mutually exclusive with thresholdCheck. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("regressionCheck")] + public global::Together.DeRegressionCheck? RegressionCheck { get; set; } + + /// + /// Optional query window for the metric. Defaults to the step soak duration. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("window")] + public string? Window { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required metric name as exported to the observability backend. + /// + /// + /// Required aggregation used for the metric. + /// + /// + /// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + /// + /// + /// Threshold evaluation criteria. Mutually exclusive with regressionCheck. + /// + /// + /// Regression evaluation criteria. Mutually exclusive with thresholdCheck. + /// + /// + /// Optional query window for the metric. Defaults to the step soak duration. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeMetricRule( + string name, + global::Together.DeMetricRuleStat stat, + int? percentile, + global::Together.DeThresholdCheck? thresholdCheck, + global::Together.DeRegressionCheck? regressionCheck, + string? window) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Stat = stat; + this.Percentile = percentile; + this.ThresholdCheck = thresholdCheck; + this.RegressionCheck = regressionCheck; + this.Window = window; + } + + /// + /// Initializes a new instance of the class. + /// + public DeMetricRule() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.Json.g.cs new file mode 100644 index 00000000..191c3504 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeMetricRuleEnum + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeMetricRuleEnum? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeMetricRuleEnum), + jsonSerializerContext) as global::Together.DeMetricRuleEnum; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeMetricRuleEnum? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeMetricRuleEnum? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeMetricRuleEnum), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeMetricRuleEnum; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.g.cs new file mode 100644 index 00000000..d99ef59e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeMetricRuleEnum + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.Json.g.cs new file mode 100644 index 00000000..39db793c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeMetricRuleEnum2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeMetricRuleEnum2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeMetricRuleEnum2), + jsonSerializerContext) as global::Together.DeMetricRuleEnum2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeMetricRuleEnum2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeMetricRuleEnum2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeMetricRuleEnum2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeMetricRuleEnum2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.g.cs new file mode 100644 index 00000000..9da8754f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRuleEnum2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeMetricRuleEnum2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricRuleStat.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricRuleStat.g.cs new file mode 100644 index 00000000..f9c4409c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricRuleStat.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Required aggregation used for the metric. + /// + public enum DeMetricRuleStat + { + /// + /// + /// + MetricStatTypeAvg, + /// + /// + /// + MetricStatTypeMax, + /// + /// + /// + MetricStatTypeMin, + /// + /// + /// + MetricStatTypePercentile, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeMetricRuleStatExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeMetricRuleStat value) + { + return value switch + { + DeMetricRuleStat.MetricStatTypeAvg => "METRIC_STAT_TYPE_AVG", + DeMetricRuleStat.MetricStatTypeMax => "METRIC_STAT_TYPE_MAX", + DeMetricRuleStat.MetricStatTypeMin => "METRIC_STAT_TYPE_MIN", + DeMetricRuleStat.MetricStatTypePercentile => "METRIC_STAT_TYPE_PERCENTILE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeMetricRuleStat? ToEnum(string value) + { + return value switch + { + "METRIC_STAT_TYPE_AVG" => DeMetricRuleStat.MetricStatTypeAvg, + "METRIC_STAT_TYPE_MAX" => DeMetricRuleStat.MetricStatTypeMax, + "METRIC_STAT_TYPE_MIN" => DeMetricRuleStat.MetricStatTypeMin, + "METRIC_STAT_TYPE_PERCENTILE" => DeMetricRuleStat.MetricStatTypePercentile, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.Json.g.cs new file mode 100644 index 00000000..4c78ae14 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeMetricsTimeRange + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeMetricsTimeRange? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeMetricsTimeRange), + jsonSerializerContext) as global::Together.DeMetricsTimeRange; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeMetricsTimeRange? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeMetricsTimeRange? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeMetricsTimeRange), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeMetricsTimeRange; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.g.cs b/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.g.cs new file mode 100644 index 00000000..4e30c7ea --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeMetricsTimeRange.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Closed-open time range used by metrics and analytics responses. + /// + public sealed partial class DeMetricsTimeRange + { + /// + /// Inclusive start of the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("startTime")] + public global::System.DateTime? StartTime { get; set; } + + /// + /// Exclusive end of the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endTime")] + public global::System.DateTime? EndTime { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Inclusive start of the time range. + /// + /// + /// Exclusive end of the time range. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeMetricsTimeRange( + global::System.DateTime? startTime, + global::System.DateTime? endTime) + { + this.StartTime = startTime; + this.EndTime = endTime; + } + + /// + /// Initializes a new instance of the class. + /// + public DeMetricsTimeRange() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModel.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModel.Json.g.cs new file mode 100644 index 00000000..41e11e3d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModel.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModel + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModel? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModel), + jsonSerializerContext) as global::Together.DeModel; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModel? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModel? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModel), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModel; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModel.g.cs b/src/libs/Together/Generated/Together.Models.DeModel.g.cs new file mode 100644 index 00000000..a4fc5101 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModel.g.cs @@ -0,0 +1,146 @@ + +#nullable enable + +namespace Together +{ + /// + /// Custom or derived model registered in a project and backed by versioned weight files. + /// + public sealed partial class DeModel + { + /// + /// Unique model identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// ID of the project that owns the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// ID of the organization that owns the model's project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("organizationId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationId { get; set; } + + /// + /// Project-qualified model name in the form `<project_slug>/<model_name>`. Create and update requests may use the bare or qualified form. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Human-readable description of the model and its intended use. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Architecture, size, precision, and speculative-decoding metadata derived from the model files. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("weights")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeModelWeights Weights { get; set; } + + /// + /// ID of the supported or custom base model from which this model was derived. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("baseModelId")] + public string? BaseModelId { get; set; } + + /// + /// Resource name of the base model, using `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("baseModel")] + public string? BaseModel { get; set; } + + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ /// global::Together.DeModelVisibility.VisibilityPrivate + [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeModelVisibilityJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeModelVisibility Visibility { get; set; } = global::Together.DeModelVisibility.VisibilityPrivate; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique model identifier. + /// + /// + /// ID of the project that owns the model. + /// + /// + /// ID of the organization that owns the model's project. + /// + /// + /// Project-qualified model name in the form `<project_slug>/<model_name>`. Create and update requests may use the bare or qualified form. + /// + /// + /// Architecture, size, precision, and speculative-decoding metadata derived from the model files. + /// + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// + /// Human-readable description of the model and its intended use. + /// + /// + /// ID of the supported or custom base model from which this model was derived. + /// + /// + /// Resource name of the base model, using `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModel( + string id, + string projectId, + string organizationId, + string name, + global::Together.DeModelWeights weights, + global::Together.DeModelVisibility visibility, + string? description, + string? baseModelId, + string? baseModel) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Weights = weights ?? throw new global::System.ArgumentNullException(nameof(weights)); + this.BaseModelId = baseModelId; + this.BaseModel = baseModel; + this.Visibility = visibility; + } + + /// + /// Initializes a new instance of the class. + /// + public DeModel() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelConfig.Json.g.cs new file mode 100644 index 00000000..a070e3b0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelConfig), + jsonSerializerContext) as global::Together.DeModelConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelConfig.g.cs b/src/libs/Together/Generated/Together.Models.DeModelConfig.g.cs new file mode 100644 index 00000000..a35cf508 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelConfig.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Together +{ + /// + /// Immutable, user-facing configuration revision that defines how a compatible model runs, including engine and hardware selectors. + /// + public sealed partial class DeModelConfig + { + /// + /// Config revision identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Model, hardware, and runtime combinations certified for this config revision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certifications")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Certifications { get; set; } + + /// + /// Deprecated. Use `referenceModel`. Reference model identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("referenceModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ReferenceModelId { get; set; } + + /// + /// Hardware and runtime selectors used to place and configure replicas. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("selectors")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Selectors { get; set; } + + /// + /// ID of the project that owns the config revision. Public configs may be owned by a different project than the deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// Resource name of the referenced model, using `projects/{modelProject}/models/{modelId}`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("referenceModel")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ReferenceModel { get; set; } + + /// + /// Resource name of the draft model, using `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is not enabled. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("draftModel")] + public string? DraftModel { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Config revision identifier. + /// + /// + /// Model, hardware, and runtime combinations certified for this config revision. + /// + /// + /// Deprecated. Use `referenceModel`. Reference model identifier. + /// + /// + /// Hardware and runtime selectors used to place and configure replicas. + /// + /// + /// ID of the project that owns the config revision. Public configs may be owned by a different project than the deployment. + /// + /// + /// Resource name of the referenced model, using `projects/{modelProject}/models/{modelId}`. + /// + /// + /// Resource name of the draft model, using `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is not enabled. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelConfig( + string id, + global::System.Collections.Generic.IList certifications, + string referenceModelId, + global::System.Collections.Generic.IList selectors, + string projectId, + string referenceModel, + string? draftModel) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Certifications = certifications ?? throw new global::System.ArgumentNullException(nameof(certifications)); + this.ReferenceModelId = referenceModelId ?? throw new global::System.ArgumentNullException(nameof(referenceModelId)); + this.Selectors = selectors ?? throw new global::System.ArgumentNullException(nameof(selectors)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.ReferenceModel = referenceModel ?? throw new global::System.ArgumentNullException(nameof(referenceModel)); + this.DraftModel = draftModel; + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.Json.g.cs new file mode 100644 index 00000000..0bb61567 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelDTypeCount + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelDTypeCount? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelDTypeCount), + jsonSerializerContext) as global::Together.DeModelDTypeCount; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelDTypeCount? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelDTypeCount? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelDTypeCount), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelDTypeCount; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.g.cs b/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.g.cs new file mode 100644 index 00000000..a6f0050a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelDTypeCount.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Number of model parameters stored in one numerical data type. + /// + public sealed partial class DeModelDTypeCount + { + /// + /// Numerical data type, such as `float16`, `bfloat16`, or `int8`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dtype")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Dtype { get; set; } + + /// + /// Number of model parameters stored with this data type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Count { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Numerical data type, such as `float16`, `bfloat16`, or `int8`. + /// + /// + /// Number of model parameters stored with this data type. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelDTypeCount( + string dtype, + string count) + { + this.Dtype = dtype ?? throw new global::System.ArgumentNullException(nameof(dtype)); + this.Count = count ?? throw new global::System.ArgumentNullException(nameof(count)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelDTypeCount() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelExternal.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelExternal.Json.g.cs new file mode 100644 index 00000000..02e5ddd5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelExternal.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelExternal + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelExternal? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelExternal), + jsonSerializerContext) as global::Together.DeModelExternal; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelExternal? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelExternal? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelExternal), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelExternal; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelExternal.g.cs b/src/libs/Together/Generated/Together.Models.DeModelExternal.g.cs new file mode 100644 index 00000000..693fe6ab --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelExternal.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// External source associated with a model. + /// + public sealed partial class DeModelExternal + { + /// + /// Canonical external URL for the model, such as its Hugging Face repository. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Canonical external URL for the model, such as its Hugging Face repository. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelExternal( + string? url) + { + this.Url = url; + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelExternal() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelLicense.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelLicense.Json.g.cs new file mode 100644 index 00000000..03f8327f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelLicense.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelLicense + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelLicense? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelLicense), + jsonSerializerContext) as global::Together.DeModelLicense; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelLicense? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelLicense? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelLicense), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelLicense; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelLicense.g.cs b/src/libs/Together/Generated/Together.Models.DeModelLicense.g.cs new file mode 100644 index 00000000..4d6b82d4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelLicense.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// License metadata associated with a model. + /// + public sealed partial class DeModelLicense + { + /// + /// License identifier or name reported by the model source. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// License identifier or name reported by the model source. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelLicense( + string? name) + { + this.Name = name; + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelLicense() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelParameters.Json.g.cs new file mode 100644 index 00000000..e49b0dce --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelParameters.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelParameters + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelParameters? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelParameters), + jsonSerializerContext) as global::Together.DeModelParameters; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelParameters? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelParameters), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelParameters; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelParameters.g.cs b/src/libs/Together/Generated/Together.Models.DeModelParameters.g.cs new file mode 100644 index 00000000..77fd6bb2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelParameters.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Model parameter count and precision breakdown. + /// + public sealed partial class DeModelParameters + { + /// + /// Total number of parameters in the model weights. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Total { get; set; } + + /// + /// Parameter counts grouped by numerical data type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("byDtype")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList ByDtype { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Total number of parameters in the model weights. + /// + /// + /// Parameter counts grouped by numerical data type. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelParameters( + string total, + global::System.Collections.Generic.IList byDtype) + { + this.Total = total ?? throw new global::System.ArgumentNullException(nameof(total)); + this.ByDtype = byDtype ?? throw new global::System.ArgumentNullException(nameof(byDtype)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelParameters() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelVisibility.g.cs b/src/libs/Together/Generated/Together.Models.DeModelVisibility.g.cs new file mode 100644 index 00000000..66af80a6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ public enum DeModelVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeModelVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeModelVisibility value) + { + return value switch + { + DeModelVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + DeModelVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeModelVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => DeModelVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => DeModelVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelWeights.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeModelWeights.Json.g.cs new file mode 100644 index 00000000..54c5b790 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelWeights.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeModelWeights + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeModelWeights? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeModelWeights), + jsonSerializerContext) as global::Together.DeModelWeights; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeModelWeights? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeModelWeights? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeModelWeights), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeModelWeights; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeModelWeights.g.cs b/src/libs/Together/Generated/Together.Models.DeModelWeights.g.cs new file mode 100644 index 00000000..e930b2fa --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelWeights.g.cs @@ -0,0 +1,104 @@ + +#nullable enable + +namespace Together +{ + /// + /// Architecture, size, precision, and speculative-decoding metadata for model weights. + /// + public sealed partial class DeModelWeights + { + /// + /// Role of the weights: full model, speculative draft model, or LoRA adapter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeModelWeightsTypeJsonConverter))] + public global::Together.DeModelWeightsType? Type { get; set; } + + /// + /// Speculative decoding mechanism for speculator weights. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("speculatorMechanism")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter))] + public global::Together.DeModelWeightsSpeculatorMechanism? SpeculatorMechanism { get; set; } + + /// + /// Draft-model speculator family for draft speculative decoding. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("draftSpeculatorType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter))] + public global::Together.DeModelWeightsDraftSpeculatorType? DraftSpeculatorType { get; set; } + + /// + /// Model architecture detected from the weight metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("architecture")] + public string? Architecture { get; set; } + + /// + /// Maximum context length reported by the model metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contextLength")] + public string? ContextLength { get; set; } + + /// + /// Total parameter count and breakdown by numerical data type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parameters")] + public global::Together.DeModelParameters? Parameters { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Role of the weights: full model, speculative draft model, or LoRA adapter. + /// + /// + /// Speculative decoding mechanism for speculator weights. + /// + /// + /// Draft-model speculator family for draft speculative decoding. + /// + /// + /// Model architecture detected from the weight metadata. + /// + /// + /// Maximum context length reported by the model metadata. + /// + /// + /// Total parameter count and breakdown by numerical data type. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeModelWeights( + global::Together.DeModelWeightsType? type, + global::Together.DeModelWeightsSpeculatorMechanism? speculatorMechanism, + global::Together.DeModelWeightsDraftSpeculatorType? draftSpeculatorType, + string? architecture, + string? contextLength, + global::Together.DeModelParameters? parameters) + { + this.Type = type; + this.SpeculatorMechanism = speculatorMechanism; + this.DraftSpeculatorType = draftSpeculatorType; + this.Architecture = architecture; + this.ContextLength = contextLength; + this.Parameters = parameters; + } + + /// + /// Initializes a new instance of the class. + /// + public DeModelWeights() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelWeightsDraftSpeculatorType.g.cs b/src/libs/Together/Generated/Together.Models.DeModelWeightsDraftSpeculatorType.g.cs new file mode 100644 index 00000000..874eaea7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelWeightsDraftSpeculatorType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Draft-model speculator family for draft speculative decoding. + /// + public enum DeModelWeightsDraftSpeculatorType + { + /// + /// + /// + DraftSpeculatorTypeEagle, + /// + /// + /// + DraftSpeculatorTypePhoenix, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeModelWeightsDraftSpeculatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeModelWeightsDraftSpeculatorType value) + { + return value switch + { + DeModelWeightsDraftSpeculatorType.DraftSpeculatorTypeEagle => "DRAFT_SPECULATOR_TYPE_EAGLE", + DeModelWeightsDraftSpeculatorType.DraftSpeculatorTypePhoenix => "DRAFT_SPECULATOR_TYPE_PHOENIX", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeModelWeightsDraftSpeculatorType? ToEnum(string value) + { + return value switch + { + "DRAFT_SPECULATOR_TYPE_EAGLE" => DeModelWeightsDraftSpeculatorType.DraftSpeculatorTypeEagle, + "DRAFT_SPECULATOR_TYPE_PHOENIX" => DeModelWeightsDraftSpeculatorType.DraftSpeculatorTypePhoenix, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelWeightsSpeculatorMechanism.g.cs b/src/libs/Together/Generated/Together.Models.DeModelWeightsSpeculatorMechanism.g.cs new file mode 100644 index 00000000..cf2e34c2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelWeightsSpeculatorMechanism.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Speculative decoding mechanism for speculator weights. + /// + public enum DeModelWeightsSpeculatorMechanism + { + /// + /// + /// + SpeculatorMechanismDraft, + /// + /// + /// + SpeculatorMechanismLookahead, + /// + /// + /// + SpeculatorMechanismMtp, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeModelWeightsSpeculatorMechanismExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeModelWeightsSpeculatorMechanism value) + { + return value switch + { + DeModelWeightsSpeculatorMechanism.SpeculatorMechanismDraft => "SPECULATOR_MECHANISM_DRAFT", + DeModelWeightsSpeculatorMechanism.SpeculatorMechanismLookahead => "SPECULATOR_MECHANISM_LOOKAHEAD", + DeModelWeightsSpeculatorMechanism.SpeculatorMechanismMtp => "SPECULATOR_MECHANISM_MTP", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeModelWeightsSpeculatorMechanism? ToEnum(string value) + { + return value switch + { + "SPECULATOR_MECHANISM_DRAFT" => DeModelWeightsSpeculatorMechanism.SpeculatorMechanismDraft, + "SPECULATOR_MECHANISM_LOOKAHEAD" => DeModelWeightsSpeculatorMechanism.SpeculatorMechanismLookahead, + "SPECULATOR_MECHANISM_MTP" => DeModelWeightsSpeculatorMechanism.SpeculatorMechanismMtp, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeModelWeightsType.g.cs b/src/libs/Together/Generated/Together.Models.DeModelWeightsType.g.cs new file mode 100644 index 00000000..66172e79 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeModelWeightsType.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Role of the weights: full model, speculative draft model, or LoRA adapter. + /// + public enum DeModelWeightsType + { + /// + /// + /// + WeightsTypeAdapter, + /// + /// + /// + WeightsTypeDefault, + /// + /// + /// + WeightsTypeSpeculator, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeModelWeightsTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeModelWeightsType value) + { + return value switch + { + DeModelWeightsType.WeightsTypeAdapter => "WEIGHTS_TYPE_ADAPTER", + DeModelWeightsType.WeightsTypeDefault => "WEIGHTS_TYPE_DEFAULT", + DeModelWeightsType.WeightsTypeSpeculator => "WEIGHTS_TYPE_SPECULATOR", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeModelWeightsType? ToEnum(string value) + { + return value switch + { + "WEIGHTS_TYPE_ADAPTER" => DeModelWeightsType.WeightsTypeAdapter, + "WEIGHTS_TYPE_DEFAULT" => DeModelWeightsType.WeightsTypeDefault, + "WEIGHTS_TYPE_SPECULATOR" => DeModelWeightsType.WeightsTypeSpeculator, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePauseInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePauseInfo.Json.g.cs new file mode 100644 index 00000000..c9e7173c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePauseInfo.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePauseInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePauseInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePauseInfo), + jsonSerializerContext) as global::Together.DePauseInfo; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePauseInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePauseInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePauseInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePauseInfo; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePauseInfo.g.cs b/src/libs/Together/Generated/Together.Models.DePauseInfo.g.cs new file mode 100644 index 00000000..aea341eb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePauseInfo.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Pause metadata returned while a rollout is paused. + /// + public sealed partial class DePauseInfo + { + /// + /// Human-readable reason recorded when the rollout was paused. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Timestamp when the rollout was paused. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pausedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime PausedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Timestamp when the rollout was paused. + /// + /// + /// Human-readable reason recorded when the rollout was paused. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePauseInfo( + global::System.DateTime pausedAt, + string? reason) + { + this.Reason = reason; + this.PausedAt = pausedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public DePauseInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.Json.g.cs new file mode 100644 index 00000000..6c2d8ee7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePauseRolloutRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePauseRolloutRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePauseRolloutRequest), + jsonSerializerContext) as global::Together.DePauseRolloutRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePauseRolloutRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePauseRolloutRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePauseRolloutRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePauseRolloutRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.g.cs b/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.g.cs new file mode 100644 index 00000000..552a36ff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePauseRolloutRequest.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optional concurrency check and audit reason for pausing a running rollout. + /// + public sealed partial class DePauseRolloutRequest + { + /// + /// Optional etag for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Optional human-readable reason recorded on the rollout pause metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional human-readable reason recorded on the rollout pause metadata. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePauseRolloutRequest( + string? etag, + string? reason) + { + this.Etag = etag; + this.Reason = reason; + } + + /// + /// Initializes a new instance of the class. + /// + public DePauseRolloutRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePlacement.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePlacement.Json.g.cs new file mode 100644 index 00000000..0695c03f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacement.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct DePlacement + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePlacement? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePlacement), + jsonSerializerContext) as global::Together.DePlacement?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePlacement? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePlacement? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePlacement), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePlacement?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePlacement.g.cs b/src/libs/Together/Generated/Together.Models.DePlacement.g.cs new file mode 100644 index 00000000..27cf61de --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacement.g.cs @@ -0,0 +1,295 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// Placement controls where a deployment is scheduled. + /// + public readonly partial struct DePlacement : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DePlacementVariant1? DePlacementVariant1 { get; init; } +#else + public global::Together.DePlacementVariant1? DePlacementVariant1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DePlacementVariant1))] +#endif + public bool IsDePlacementVariant1 => DePlacementVariant1 != null; + + /// + /// + /// + public bool TryPickDePlacementVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DePlacementVariant1? value) + { + value = DePlacementVariant1; + return IsDePlacementVariant1; + } + + /// + /// + /// + public global::Together.DePlacementVariant1 PickDePlacementVariant1() => IsDePlacementVariant1 + ? DePlacementVariant1! + : throw new global::System.InvalidOperationException($"Expected union variant 'DePlacementVariant1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DePlacementVariant2? DePlacementVariant2 { get; init; } +#else + public global::Together.DePlacementVariant2? DePlacementVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DePlacementVariant2))] +#endif + public bool IsDePlacementVariant2 => DePlacementVariant2 != null; + + /// + /// + /// + public bool TryPickDePlacementVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DePlacementVariant2? value) + { + value = DePlacementVariant2; + return IsDePlacementVariant2; + } + + /// + /// + /// + public global::Together.DePlacementVariant2 PickDePlacementVariant2() => IsDePlacementVariant2 + ? DePlacementVariant2! + : throw new global::System.InvalidOperationException($"Expected union variant 'DePlacementVariant2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator DePlacement(global::Together.DePlacementVariant1 value) => new DePlacement((global::Together.DePlacementVariant1?)value); + + /// + /// + /// + public static implicit operator global::Together.DePlacementVariant1?(DePlacement @this) => @this.DePlacementVariant1; + + /// + /// + /// + public DePlacement(global::Together.DePlacementVariant1? value) + { + DePlacementVariant1 = value; + } + + /// + /// + /// + public static DePlacement FromDePlacementVariant1(global::Together.DePlacementVariant1? value) => new DePlacement(value); + + /// + /// + /// + public static implicit operator DePlacement(global::Together.DePlacementVariant2 value) => new DePlacement((global::Together.DePlacementVariant2?)value); + + /// + /// + /// + public static implicit operator global::Together.DePlacementVariant2?(DePlacement @this) => @this.DePlacementVariant2; + + /// + /// + /// + public DePlacement(global::Together.DePlacementVariant2? value) + { + DePlacementVariant2 = value; + } + + /// + /// + /// + public static DePlacement FromDePlacementVariant2(global::Together.DePlacementVariant2? value) => new DePlacement(value); + + /// + /// + /// + public DePlacement( + global::Together.DePlacementVariant1? dePlacementVariant1, + global::Together.DePlacementVariant2? dePlacementVariant2 + ) + { + DePlacementVariant1 = dePlacementVariant1; + DePlacementVariant2 = dePlacementVariant2; + } + + /// + /// + /// + public object? Object => + DePlacementVariant2 as object ?? + DePlacementVariant1 as object + ; + + /// + /// + /// + public override string? ToString() => + DePlacementVariant1?.ToString() ?? + DePlacementVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsDePlacementVariant1 && !IsDePlacementVariant2 || !IsDePlacementVariant1 && IsDePlacementVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? dePlacementVariant1 = null, + global::System.Func? dePlacementVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDePlacementVariant1 && dePlacementVariant1 != null) + { + return dePlacementVariant1(DePlacementVariant1!); + } + else if (IsDePlacementVariant2 && dePlacementVariant2 != null) + { + return dePlacementVariant2(DePlacementVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? dePlacementVariant1 = null, + + global::System.Action? dePlacementVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDePlacementVariant1) + { + dePlacementVariant1?.Invoke(DePlacementVariant1!); + } + else if (IsDePlacementVariant2) + { + dePlacementVariant2?.Invoke(DePlacementVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? dePlacementVariant1 = null, + global::System.Action? dePlacementVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDePlacementVariant1) + { + dePlacementVariant1?.Invoke(DePlacementVariant1!); + } + else if (IsDePlacementVariant2) + { + dePlacementVariant2?.Invoke(DePlacementVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + DePlacementVariant1, + typeof(global::Together.DePlacementVariant1), + DePlacementVariant2, + typeof(global::Together.DePlacementVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(DePlacement other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(DePlacementVariant1, other.DePlacementVariant1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DePlacementVariant2, other.DePlacementVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(DePlacement obj1, DePlacement obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(DePlacement obj1, DePlacement obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is DePlacement o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePlacementProfile.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementProfile.Json.g.cs new file mode 100644 index 00000000..bd46a9f6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementProfile.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePlacementProfile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePlacementProfile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePlacementProfile), + jsonSerializerContext) as global::Together.DePlacementProfile; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePlacementProfile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePlacementProfile? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePlacementProfile), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePlacementProfile; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePlacementProfile.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementProfile.g.cs new file mode 100644 index 00000000..8df43141 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementProfile.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace Together +{ + /// + /// Reusable ordered region preferences for scheduling a project's deployments. + /// + public sealed partial class DePlacementProfile + { + /// + /// Unique placement profile identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Project that owns the placement profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// Organization that owns the placement profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("organizationId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationId { get; set; } + + /// + /// Human-readable placement profile name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Preferred deployment regions in descending priority order. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("preferredRegions")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList PreferredRegions { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique placement profile identifier. + /// + /// + /// Project that owns the placement profile. + /// + /// + /// Organization that owns the placement profile. + /// + /// + /// Human-readable placement profile name. + /// + /// + /// Preferred deployment regions in descending priority order. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePlacementProfile( + string id, + string projectId, + string organizationId, + string name, + global::System.Collections.Generic.IList preferredRegions) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.PreferredRegions = preferredRegions ?? throw new global::System.ArgumentNullException(nameof(preferredRegions)); + } + + /// + /// Initializes a new instance of the class. + /// + public DePlacementProfile() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePlacementVariant1.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementVariant1.Json.g.cs new file mode 100644 index 00000000..7233990d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementVariant1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePlacementVariant1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePlacementVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePlacementVariant1), + jsonSerializerContext) as global::Together.DePlacementVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePlacementVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePlacementVariant1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePlacementVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePlacementVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePlacementVariant1.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementVariant1.g.cs new file mode 100644 index 00000000..b223a40d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementVariant1.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DePlacementVariant1 + { + /// + /// Inline placement parameters evaluated at deploy time. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inline")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeInlinePlacement Inline { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Inline placement parameters evaluated at deploy time. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePlacementVariant1( + global::Together.DeInlinePlacement inline) + { + this.Inline = inline ?? throw new global::System.ArgumentNullException(nameof(inline)); + } + + /// + /// Initializes a new instance of the class. + /// + public DePlacementVariant1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePlacementVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementVariant2.Json.g.cs new file mode 100644 index 00000000..c541249a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePlacementVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePlacementVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePlacementVariant2), + jsonSerializerContext) as global::Together.DePlacementVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePlacementVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePlacementVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePlacementVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePlacementVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePlacementVariant2.g.cs b/src/libs/Together/Generated/Together.Models.DePlacementVariant2.g.cs new file mode 100644 index 00000000..c4d14d9a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePlacementVariant2.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DePlacementVariant2 + { + /// + /// UID of a saved placement profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("profile")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Profile { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// UID of a saved placement profile. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePlacementVariant2( + string profile) + { + this.Profile = profile ?? throw new global::System.ArgumentNullException(nameof(profile)); + } + + /// + /// Initializes a new instance of the class. + /// + public DePlacementVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.Json.g.cs new file mode 100644 index 00000000..feb37217 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePromoteRolloutRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePromoteRolloutRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePromoteRolloutRequest), + jsonSerializerContext) as global::Together.DePromoteRolloutRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePromoteRolloutRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePromoteRolloutRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePromoteRolloutRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePromoteRolloutRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.g.cs b/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.g.cs new file mode 100644 index 00000000..f4ad2259 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePromoteRolloutRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optional concurrency check for immediately completing a rollout on its target deployment. + /// + public sealed partial class DePromoteRolloutRequest + { + /// + /// Optional etag for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Optional etag for optimistic concurrency. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePromoteRolloutRequest( + string? etag) + { + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DePromoteRolloutRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DePublicEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.DePublicEndpoint.Json.g.cs new file mode 100644 index 00000000..ef647854 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePublicEndpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DePublicEndpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DePublicEndpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DePublicEndpoint), + jsonSerializerContext) as global::Together.DePublicEndpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DePublicEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DePublicEndpoint? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DePublicEndpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DePublicEndpoint; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DePublicEndpoint.g.cs b/src/libs/Together/Generated/Together.Models.DePublicEndpoint.g.cs new file mode 100644 index 00000000..af2bc902 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DePublicEndpoint.g.cs @@ -0,0 +1,107 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint metadata exposed through the public endpoint catalog. + /// + public sealed partial class DePublicEndpoint + { + /// + /// Unique endpoint identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// ID of the project that owns the endpoint. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// Endpoint string in the form `<project_slug>/<endpoint_name>`, passed as the `model` parameter when calling inference. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Timestamp when the endpoint was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Timestamp when the endpoint was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Public visibility of the endpoint. + /// + /// "VISIBILITY_PUBLIC" + [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + public string Visibility { get; set; } = "VISIBILITY_PUBLIC"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique endpoint identifier. + /// + /// + /// ID of the project that owns the endpoint. + /// + /// + /// Endpoint string in the form `<project_slug>/<endpoint_name>`, passed as the `model` parameter when calling inference. + /// + /// + /// Timestamp when the endpoint was created. + /// + /// + /// Timestamp when the endpoint was last updated. + /// + /// + /// Public visibility of the endpoint. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DePublicEndpoint( + string id, + string projectId, + string name, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string visibility = "VISIBILITY_PUBLIC") + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Visibility = visibility; + } + + /// + /// Initializes a new instance of the class. + /// + public DePublicEndpoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRegion.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRegion.Json.g.cs new file mode 100644 index 00000000..9bb7eccd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRegion.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRegion + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRegion? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRegion), + jsonSerializerContext) as global::Together.DeRegion; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRegion? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRegion? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRegion), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRegion; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRegion.g.cs b/src/libs/Together/Generated/Together.Models.DeRegion.g.cs new file mode 100644 index 00000000..84fe9e43 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRegion.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Region where an instance type is offered. + /// + public sealed partial class DeRegion + { + /// + /// Region name where an instance type is offered. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Best-effort replica headroom for this region. Omitted when unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("headroom")] + public global::Together.DeHeadroom? Headroom { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Region name where an instance type is offered. + /// + /// + /// Best-effort replica headroom for this region. Omitted when unavailable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRegion( + string name, + global::Together.DeHeadroom? headroom) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Headroom = headroom; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRegion() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRegressionCheck.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRegressionCheck.Json.g.cs new file mode 100644 index 00000000..406ca2f1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRegressionCheck.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRegressionCheck + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRegressionCheck? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRegressionCheck), + jsonSerializerContext) as global::Together.DeRegressionCheck; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRegressionCheck? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRegressionCheck? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRegressionCheck), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRegressionCheck; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRegressionCheck.g.cs b/src/libs/Together/Generated/Together.Models.DeRegressionCheck.g.cs new file mode 100644 index 00000000..10093d60 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRegressionCheck.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Together +{ + /// + /// Regression criteria that fail when the target regresses against the source beyond a limit. + /// + public sealed partial class DeRegressionCheck + { + /// + /// Required maximum allowed regression percentage. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxRegressionPercent")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double MaxRegressionPercent { get; set; } + + /// + /// Required direction that indicates whether higher or lower metric values are worse. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("direction")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeRegressionCheckDirection Direction { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required maximum allowed regression percentage. + /// + /// + /// Required direction that indicates whether higher or lower metric values are worse. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRegressionCheck( + double maxRegressionPercent, + global::Together.DeRegressionCheckDirection direction) + { + this.MaxRegressionPercent = maxRegressionPercent; + this.Direction = direction; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRegressionCheck() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRegressionCheckDirection.g.cs b/src/libs/Together/Generated/Together.Models.DeRegressionCheckDirection.g.cs new file mode 100644 index 00000000..6157e94f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRegressionCheckDirection.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Required direction that indicates whether higher or lower metric values are worse. + /// + public enum DeRegressionCheckDirection + { + /// + /// + /// + RegressionDirectionHigherIsWorse, + /// + /// + /// + RegressionDirectionLowerIsWorse, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRegressionCheckDirectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRegressionCheckDirection value) + { + return value switch + { + DeRegressionCheckDirection.RegressionDirectionHigherIsWorse => "REGRESSION_DIRECTION_HIGHER_IS_WORSE", + DeRegressionCheckDirection.RegressionDirectionLowerIsWorse => "REGRESSION_DIRECTION_LOWER_IS_WORSE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRegressionCheckDirection? ToEnum(string value) + { + return value switch + { + "REGRESSION_DIRECTION_HIGHER_IS_WORSE" => DeRegressionCheckDirection.RegressionDirectionHigherIsWorse, + "REGRESSION_DIRECTION_LOWER_IS_WORSE" => DeRegressionCheckDirection.RegressionDirectionLowerIsWorse, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUpload.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUpload.Json.g.cs new file mode 100644 index 00000000..9c6360ff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUpload.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRemoteUpload + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRemoteUpload? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRemoteUpload), + jsonSerializerContext) as global::Together.DeRemoteUpload; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRemoteUpload? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRemoteUpload? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRemoteUpload), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRemoteUpload; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUpload.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUpload.g.cs new file mode 100644 index 00000000..87f4332b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUpload.g.cs @@ -0,0 +1,152 @@ + +#nullable enable + +namespace Together +{ + /// + /// Asynchronous job that imports remote files into a registered model and creates a model revision. + /// + public sealed partial class DeRemoteUpload + { + /// + /// Unique ID of the remote model import job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// ID of the project that owns the import job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// ID of the registered model receiving the imported files. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("modelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Hugging Face repository or presigned URL being imported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("remoteUrl")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RemoteUrl { get; set; } + + /// + /// Current lifecycle state of the asynchronous import job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeRemoteUploadStatus Status { get; set; } + + /// + /// Human-readable progress or failure detail for the current status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("statusMessage")] + public string? StatusMessage { get; set; } + + /// + /// Number of times the import worker has restarted this job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("restartCount")] + public int? RestartCount { get; set; } + + /// + /// Maximum worker restarts allowed before the job fails permanently. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxRestarts")] + public int? MaxRestarts { get; set; } + + /// + /// Time when the import job was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Time when the import job was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique ID of the remote model import job. + /// + /// + /// ID of the project that owns the import job. + /// + /// + /// ID of the registered model receiving the imported files. + /// + /// + /// Hugging Face repository or presigned URL being imported. + /// + /// + /// Current lifecycle state of the asynchronous import job. + /// + /// + /// Time when the import job was created. + /// + /// + /// Human-readable progress or failure detail for the current status. + /// + /// + /// Number of times the import worker has restarted this job. + /// + /// + /// Maximum worker restarts allowed before the job fails permanently. + /// + /// + /// Time when the import job was last updated. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRemoteUpload( + string id, + string projectId, + string modelId, + string remoteUrl, + global::Together.DeRemoteUploadStatus status, + global::System.DateTime createdAt, + string? statusMessage, + int? restartCount, + int? maxRestarts, + global::System.DateTime? updatedAt) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + this.RemoteUrl = remoteUrl ?? throw new global::System.ArgumentNullException(nameof(remoteUrl)); + this.Status = status; + this.StatusMessage = statusMessage; + this.RestartCount = restartCount; + this.MaxRestarts = maxRestarts; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRemoteUpload() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.Json.g.cs new file mode 100644 index 00000000..7b1e7465 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRemoteUploadEvent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRemoteUploadEvent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRemoteUploadEvent), + jsonSerializerContext) as global::Together.DeRemoteUploadEvent; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRemoteUploadEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRemoteUploadEvent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRemoteUploadEvent), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRemoteUploadEvent; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.g.cs new file mode 100644 index 00000000..c64f0bdc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEvent.g.cs @@ -0,0 +1,96 @@ + +#nullable enable + +namespace Together +{ + /// + /// Progress or diagnostic event emitted while importing remote model files. + /// + public sealed partial class DeRemoteUploadEvent + { + /// + /// Unique event identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Time when the event was recorded. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Severity of the event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("level")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeRemoteUploadEventLevel Level { get; set; } + + /// + /// Stable event type emitted by the importer, such as `download.started`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// Human-readable progress or diagnostic message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique event identifier. + /// + /// + /// Time when the event was recorded. + /// + /// + /// Severity of the event. + /// + /// + /// Stable event type emitted by the importer, such as `download.started`. + /// + /// + /// Human-readable progress or diagnostic message. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRemoteUploadEvent( + string id, + global::System.DateTime createdAt, + global::Together.DeRemoteUploadEventLevel level, + string type, + string message) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.CreatedAt = createdAt; + this.Level = level; + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeRemoteUploadEvent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUploadEventLevel.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEventLevel.g.cs new file mode 100644 index 00000000..29fd78d5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUploadEventLevel.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Severity of the event. + /// + public enum DeRemoteUploadEventLevel + { + /// + /// + /// + LevelDebug, + /// + /// + /// + LevelError, + /// + /// + /// + LevelInfo, + /// + /// + /// + LevelWarn, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRemoteUploadEventLevelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRemoteUploadEventLevel value) + { + return value switch + { + DeRemoteUploadEventLevel.LevelDebug => "LEVEL_DEBUG", + DeRemoteUploadEventLevel.LevelError => "LEVEL_ERROR", + DeRemoteUploadEventLevel.LevelInfo => "LEVEL_INFO", + DeRemoteUploadEventLevel.LevelWarn => "LEVEL_WARN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRemoteUploadEventLevel? ToEnum(string value) + { + return value switch + { + "LEVEL_DEBUG" => DeRemoteUploadEventLevel.LevelDebug, + "LEVEL_ERROR" => DeRemoteUploadEventLevel.LevelError, + "LEVEL_INFO" => DeRemoteUploadEventLevel.LevelInfo, + "LEVEL_WARN" => DeRemoteUploadEventLevel.LevelWarn, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRemoteUploadStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeRemoteUploadStatus.g.cs new file mode 100644 index 00000000..00821755 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRemoteUploadStatus.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current lifecycle state of the asynchronous import job. + /// + public enum DeRemoteUploadStatus + { + /// + /// + /// + RemoteUploadStatusError, + /// + /// + /// + RemoteUploadStatusFailed, + /// + /// + /// + RemoteUploadStatusPending, + /// + /// + /// + RemoteUploadStatusRunning, + /// + /// + /// + RemoteUploadStatusSucceeded, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRemoteUploadStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRemoteUploadStatus value) + { + return value switch + { + DeRemoteUploadStatus.RemoteUploadStatusError => "REMOTE_UPLOAD_STATUS_ERROR", + DeRemoteUploadStatus.RemoteUploadStatusFailed => "REMOTE_UPLOAD_STATUS_FAILED", + DeRemoteUploadStatus.RemoteUploadStatusPending => "REMOTE_UPLOAD_STATUS_PENDING", + DeRemoteUploadStatus.RemoteUploadStatusRunning => "REMOTE_UPLOAD_STATUS_RUNNING", + DeRemoteUploadStatus.RemoteUploadStatusSucceeded => "REMOTE_UPLOAD_STATUS_SUCCEEDED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRemoteUploadStatus? ToEnum(string value) + { + return value switch + { + "REMOTE_UPLOAD_STATUS_ERROR" => DeRemoteUploadStatus.RemoteUploadStatusError, + "REMOTE_UPLOAD_STATUS_FAILED" => DeRemoteUploadStatus.RemoteUploadStatusFailed, + "REMOTE_UPLOAD_STATUS_PENDING" => DeRemoteUploadStatus.RemoteUploadStatusPending, + "REMOTE_UPLOAD_STATUS_RUNNING" => DeRemoteUploadStatus.RemoteUploadStatusRunning, + "REMOTE_UPLOAD_STATUS_SUCCEEDED" => DeRemoteUploadStatus.RemoteUploadStatusSucceeded, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRequestMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRequestMetrics.Json.g.cs new file mode 100644 index 00000000..f1d11807 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRequestMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRequestMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRequestMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRequestMetrics), + jsonSerializerContext) as global::Together.DeRequestMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRequestMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRequestMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRequestMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRequestMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRequestMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeRequestMetrics.g.cs new file mode 100644 index 00000000..3c870b34 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRequestMetrics.g.cs @@ -0,0 +1,90 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request counts, rate, and status-code distribution over a time range. + /// + public sealed partial class DeRequestMetrics + { + /// + /// Total requests received during the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalRequests")] + public string? TotalRequests { get; set; } + + /// + /// Requests completed successfully during the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("successfulRequests")] + public string? SuccessfulRequests { get; set; } + + /// + /// Requests that failed during the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("failedRequests")] + public string? FailedRequests { get; set; } + + /// + /// Average requests per second over the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requestsPerSecond")] + public double? RequestsPerSecond { get; set; } + + /// + /// Request counts keyed by HTTP status code. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requestsByStatusCode")] + public global::System.Collections.Generic.Dictionary? RequestsByStatusCode { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Total requests received during the time range. + /// + /// + /// Requests completed successfully during the time range. + /// + /// + /// Requests that failed during the time range. + /// + /// + /// Average requests per second over the time range. + /// + /// + /// Request counts keyed by HTTP status code. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRequestMetrics( + string? totalRequests, + string? successfulRequests, + string? failedRequests, + double? requestsPerSecond, + global::System.Collections.Generic.Dictionary? requestsByStatusCode) + { + this.TotalRequests = totalRequests; + this.SuccessfulRequests = successfulRequests; + this.FailedRequests = failedRequests; + this.RequestsPerSecond = requestsPerSecond; + this.RequestsByStatusCode = requestsByStatusCode; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRequestMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.Json.g.cs new file mode 100644 index 00000000..16479a19 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRequestMetricsRequestsByStatusCode + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRequestMetricsRequestsByStatusCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRequestMetricsRequestsByStatusCode), + jsonSerializerContext) as global::Together.DeRequestMetricsRequestsByStatusCode; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRequestMetricsRequestsByStatusCode? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRequestMetricsRequestsByStatusCode? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRequestMetricsRequestsByStatusCode), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRequestMetricsRequestsByStatusCode; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.g.cs b/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.g.cs new file mode 100644 index 00000000..65ed7e18 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRequestMetricsRequestsByStatusCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request counts keyed by HTTP status code. + /// + public sealed partial class DeRequestMetricsRequestsByStatusCode + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeResourceUtilization.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeResourceUtilization.Json.g.cs new file mode 100644 index 00000000..3dd28542 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeResourceUtilization.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeResourceUtilization + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeResourceUtilization? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeResourceUtilization), + jsonSerializerContext) as global::Together.DeResourceUtilization; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeResourceUtilization? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeResourceUtilization? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeResourceUtilization), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeResourceUtilization; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeResourceUtilization.g.cs b/src/libs/Together/Generated/Together.Models.DeResourceUtilization.g.cs new file mode 100644 index 00000000..c5de83b3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeResourceUtilization.g.cs @@ -0,0 +1,90 @@ + +#nullable enable + +namespace Together +{ + /// + /// Average compute, memory, and network utilization for replicas over a time range. + /// + public sealed partial class DeResourceUtilization + { + /// + /// Average CPU utilization across replicas, as a percentage. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cpuUtilization")] + public double? CpuUtilization { get; set; } + + /// + /// Average GPU compute utilization across replicas, as a percentage. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuUtilization")] + public double? GpuUtilization { get; set; } + + /// + /// Average system memory utilization across replicas, as a percentage. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("memoryUtilization")] + public double? MemoryUtilization { get; set; } + + /// + /// Average GPU memory utilization across replicas, as a percentage. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuMemoryUtilization")] + public double? GpuMemoryUtilization { get; set; } + + /// + /// Average network throughput across replicas, in megabits per second. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("networkBandwidthMbps")] + public double? NetworkBandwidthMbps { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Average CPU utilization across replicas, as a percentage. + /// + /// + /// Average GPU compute utilization across replicas, as a percentage. + /// + /// + /// Average system memory utilization across replicas, as a percentage. + /// + /// + /// Average GPU memory utilization across replicas, as a percentage. + /// + /// + /// Average network throughput across replicas, in megabits per second. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeResourceUtilization( + double? cpuUtilization, + double? gpuUtilization, + double? memoryUtilization, + double? gpuMemoryUtilization, + double? networkBandwidthMbps) + { + this.CpuUtilization = cpuUtilization; + this.GpuUtilization = gpuUtilization; + this.MemoryUtilization = memoryUtilization; + this.GpuMemoryUtilization = gpuMemoryUtilization; + this.NetworkBandwidthMbps = networkBandwidthMbps; + } + + /// + /// Initializes a new instance of the class. + /// + public DeResourceUtilization() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.Json.g.cs new file mode 100644 index 00000000..97234337 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeResumeRolloutRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeResumeRolloutRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeResumeRolloutRequest), + jsonSerializerContext) as global::Together.DeResumeRolloutRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeResumeRolloutRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeResumeRolloutRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeResumeRolloutRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeResumeRolloutRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.g.cs new file mode 100644 index 00000000..7925c345 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeResumeRolloutRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optional concurrency check for resuming a paused rollout. + /// + public sealed partial class DeResumeRolloutRequest + { + /// + /// Optional etag for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Optional etag for optimistic concurrency. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeResumeRolloutRequest( + string? etag) + { + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DeResumeRolloutRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.Json.g.cs new file mode 100644 index 00000000..7dbdb824 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRevisionValidationError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRevisionValidationError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRevisionValidationError), + jsonSerializerContext) as global::Together.DeRevisionValidationError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRevisionValidationError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRevisionValidationError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRevisionValidationError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRevisionValidationError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.g.cs b/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.g.cs new file mode 100644 index 00000000..732b9402 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevisionValidationError.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// One validation error reported for a model revision. + /// + public sealed partial class DeRevisionValidationError + { + /// + /// Validation rule that produced the error. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rule")] + public string? Rule { get; set; } + + /// + /// Severity level reported by the validation rule. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("severity")] + public string? Severity { get; set; } + + /// + /// Human-readable validation error message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Validation rule that produced the error. + /// + /// + /// Severity level reported by the validation rule. + /// + /// + /// Human-readable validation error message. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRevisionValidationError( + string? rule, + string? severity, + string? message) + { + this.Rule = rule; + this.Severity = severity; + this.Message = message; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRevisionValidationError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.Json.g.cs new file mode 100644 index 00000000..ecfac351 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRevokeEndpointAccessRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRevokeEndpointAccessRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRevokeEndpointAccessRequest), + jsonSerializerContext) as global::Together.DeRevokeEndpointAccessRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRevokeEndpointAccessRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRevokeEndpointAccessRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRevokeEndpointAccessRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRevokeEndpointAccessRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.g.cs new file mode 100644 index 00000000..1772055a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessRequest.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Principal whose permission to call the endpoint should be revoked. + /// + public sealed partial class DeRevokeEndpointAccessRequest + { + /// + /// Type of principal to revoke. Supported values are `project`, `api_key`, and `organization`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalType { get; set; } + + /// + /// Identifier of the principal whose access is being revoked. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("principalId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrincipalId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Type of principal to revoke. Supported values are `project`, `api_key`, and `organization`. + /// + /// + /// Identifier of the principal whose access is being revoked. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRevokeEndpointAccessRequest( + string principalType, + string principalId) + { + this.PrincipalType = principalType ?? throw new global::System.ArgumentNullException(nameof(principalType)); + this.PrincipalId = principalId ?? throw new global::System.ArgumentNullException(nameof(principalId)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeRevokeEndpointAccessRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.Json.g.cs new file mode 100644 index 00000000..7a90d1af --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRevokeEndpointAccessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRevokeEndpointAccessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRevokeEndpointAccessResponse), + jsonSerializerContext) as global::Together.DeRevokeEndpointAccessResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRevokeEndpointAccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRevokeEndpointAccessResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRevokeEndpointAccessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRevokeEndpointAccessResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.g.cs new file mode 100644 index 00000000..53569cab --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRevokeEndpointAccessResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Empty response returned after an endpoint access grant is revoked or confirmed absent. + /// + public sealed partial class DeRevokeEndpointAccessResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRollingConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRollingConfig.Json.g.cs new file mode 100644 index 00000000..635389e9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRollingConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRollingConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRollingConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRollingConfig), + jsonSerializerContext) as global::Together.DeRollingConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRollingConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRollingConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRollingConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRollingConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRollingConfig.g.cs b/src/libs/Together/Generated/Together.Models.DeRollingConfig.g.cs new file mode 100644 index 00000000..1e7598e9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRollingConfig.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Rolling strategy configuration for capacity-preserving batches that ramp target replicas up while draining source replicas. + /// + public sealed partial class DeRollingConfig + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRollout.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRollout.Json.g.cs new file mode 100644 index 00000000..8ad81d33 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRollout.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRollout + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRollout? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRollout), + jsonSerializerContext) as global::Together.DeRollout; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRollout? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRollout? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRollout), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRollout; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRollout.g.cs b/src/libs/Together/Generated/Together.Models.DeRollout.g.cs new file mode 100644 index 00000000..d2b3ccb5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRollout.g.cs @@ -0,0 +1,227 @@ + +#nullable enable + +namespace Together +{ + /// + /// Public view of a rollout resource and its embedded runtime status. + /// + public sealed partial class DeRollout + { + /// + /// Output only. Unique rollout identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// Output only. Endpoint this rollout belongs to.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string EndpointId { get; set; } = default!; + + /// + /// Output only. Deployment that traffic is shifting away from.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("sourceDeploymentId")] + public string SourceDeploymentId { get; set; } = default!; + + /// + /// Output only. Deployment that traffic is shifting toward.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("targetDeploymentId")] + public string TargetDeploymentId { get; set; } = default!; + + /// + /// Output only. Rollout strategy selected at creation.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("strategy")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRolloutStrategyJsonConverter))] + public global::Together.DeRolloutStrategy Strategy { get; set; } = default!; + + /// + /// Output only. High-level rollout lifecycle state.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRolloutStateJsonConverter))] + public global::Together.DeRolloutState State { get; set; } = default!; + + /// + /// Output only. Zero-based index of the current step. Unset while PENDING; step 0 is reported explicitly after start.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("currentStep")] + public int? CurrentStep { get; set; } + + /// + /// Output only. Applied percentage of traffic on the target deployment.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("currentTrafficPercent")] + public int? CurrentTrafficPercent { get; set; } + + /// + /// Output only. Timestamp when the rollout was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Output only. Timestamp when the rollout started running.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public global::System.DateTime? StartedAt { get; set; } + + /// + /// Output only. Timestamp when the rollout reached a terminal state.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("completedAt")] + public global::System.DateTime? CompletedAt { get; set; } + + /// + /// Output only. Opaque version tag for optimistic concurrency control.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Output only. Derived runtime progress and failure details.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + public global::Together.DeRolloutStatus Status { get; set; } = default!; + + /// + /// Output only. Why and when the rollout was paused. Set only while paused or system-paused.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("pauseInfo")] + public global::Together.DePauseInfo? PauseInfo { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Output only. Zero-based index of the current step. Unset while PENDING; step 0 is reported explicitly after start.
+ /// Included only in responses + /// + /// + /// Output only. Applied percentage of traffic on the target deployment.
+ /// Included only in responses + /// + /// + /// Output only. Timestamp when the rollout started running.
+ /// Included only in responses + /// + /// + /// Output only. Timestamp when the rollout reached a terminal state.
+ /// Included only in responses + /// + /// + /// Output only. Opaque version tag for optimistic concurrency control.
+ /// Included only in responses + /// + /// + /// Output only. Why and when the rollout was paused. Set only while paused or system-paused.
+ /// Included only in responses + /// + /// + /// Output only. Unique rollout identifier.
+ /// Included only in responses + /// + /// + /// Output only. Endpoint this rollout belongs to.
+ /// Included only in responses + /// + /// + /// Output only. Deployment that traffic is shifting away from.
+ /// Included only in responses + /// + /// + /// Output only. Deployment that traffic is shifting toward.
+ /// Included only in responses + /// + /// + /// Output only. Rollout strategy selected at creation.
+ /// Included only in responses + /// + /// + /// Output only. High-level rollout lifecycle state.
+ /// Included only in responses + /// + /// + /// Output only. Timestamp when the rollout was created.
+ /// Included only in responses + /// + /// + /// Output only. Derived runtime progress and failure details.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRollout( + int? currentStep, + int? currentTrafficPercent, + global::System.DateTime? startedAt, + global::System.DateTime? completedAt, + string? etag, + global::Together.DePauseInfo? pauseInfo, + string id = default!, + string endpointId = default!, + string sourceDeploymentId = default!, + string targetDeploymentId = default!, + global::Together.DeRolloutStrategy strategy = default!, + global::Together.DeRolloutState state = default!, + global::System.DateTime createdAt = default!, + global::Together.DeRolloutStatus status = default!) + { + this.Id = id; + this.EndpointId = endpointId; + this.SourceDeploymentId = sourceDeploymentId; + this.TargetDeploymentId = targetDeploymentId; + this.Strategy = strategy; + this.State = state; + this.CurrentStep = currentStep; + this.CurrentTrafficPercent = currentTrafficPercent; + this.CreatedAt = createdAt; + this.StartedAt = startedAt; + this.CompletedAt = completedAt; + this.Etag = etag; + this.Status = status; + this.PauseInfo = pauseInfo; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRollout() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutCondition.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutCondition.Json.g.cs new file mode 100644 index 00000000..ff5432b9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutCondition.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRolloutCondition + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRolloutCondition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRolloutCondition), + jsonSerializerContext) as global::Together.DeRolloutCondition; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRolloutCondition? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRolloutCondition? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRolloutCondition), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRolloutCondition; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutCondition.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutCondition.g.cs new file mode 100644 index 00000000..ba4fc2ce --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutCondition.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Together +{ + /// + /// Structured reason a rollout stopped progressing. + /// + public sealed partial class DeRolloutCondition + { + /// + /// Category that classifies why the rollout stopped. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("category")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter))] + public global::Together.DeRolloutConditionCategory? Category { get; set; } + + /// + /// Human-readable explanation for the condition. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Step index where the condition arose. Step 0 serializes explicitly. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("atStep")] + public int? AtStep { get; set; } + + /// + /// Timestamp when the condition was observed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("observedAt")] + public global::System.DateTime? ObservedAt { get; set; } + + /// + /// Metrics observed at the failing gate, enriched with their criteria. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] + public global::System.Collections.Generic.IList? Metrics { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Category that classifies why the rollout stopped. + /// + /// + /// Human-readable explanation for the condition. + /// + /// + /// Step index where the condition arose. Step 0 serializes explicitly. + /// + /// + /// Timestamp when the condition was observed. + /// + /// + /// Metrics observed at the failing gate, enriched with their criteria. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRolloutCondition( + global::Together.DeRolloutConditionCategory? category, + string? message, + int? atStep, + global::System.DateTime? observedAt, + global::System.Collections.Generic.IList? metrics) + { + this.Category = category; + this.Message = message; + this.AtStep = atStep; + this.ObservedAt = observedAt; + this.Metrics = metrics; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRolloutCondition() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutConditionCategory.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutConditionCategory.g.cs new file mode 100644 index 00000000..5f769dff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutConditionCategory.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace Together +{ + /// + /// Category that classifies why the rollout stopped. + /// + public enum DeRolloutConditionCategory + { + /// + /// + /// + RolloutFailureCategoryAbortedByOperator, + /// + /// + /// + RolloutFailureCategoryCapacityExhausted, + /// + /// + /// + RolloutFailureCategoryDependencyOutage, + /// + /// + /// + RolloutFailureCategoryEntitlementLapsed, + /// + /// + /// + RolloutFailureCategoryHealthRegression, + /// + /// + /// + RolloutFailureCategoryInternal, + /// + /// + /// + RolloutFailureCategoryMetricsUnavailable, + /// + /// + /// + RolloutFailureCategoryMetricRegression, + /// + /// + /// + RolloutFailureCategoryPolicyInfeasible, + /// + /// + /// + RolloutFailureCategoryRoutingError, + /// + /// + /// + RolloutFailureCategorySourceNotDrained, + /// + /// + /// + RolloutFailureCategoryTargetNotReady, + /// + /// + /// + RolloutFailureCategoryUnderServed, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRolloutConditionCategoryExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRolloutConditionCategory value) + { + return value switch + { + DeRolloutConditionCategory.RolloutFailureCategoryAbortedByOperator => "ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR", + DeRolloutConditionCategory.RolloutFailureCategoryCapacityExhausted => "ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED", + DeRolloutConditionCategory.RolloutFailureCategoryDependencyOutage => "ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE", + DeRolloutConditionCategory.RolloutFailureCategoryEntitlementLapsed => "ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED", + DeRolloutConditionCategory.RolloutFailureCategoryHealthRegression => "ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION", + DeRolloutConditionCategory.RolloutFailureCategoryInternal => "ROLLOUT_FAILURE_CATEGORY_INTERNAL", + DeRolloutConditionCategory.RolloutFailureCategoryMetricsUnavailable => "ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE", + DeRolloutConditionCategory.RolloutFailureCategoryMetricRegression => "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION", + DeRolloutConditionCategory.RolloutFailureCategoryPolicyInfeasible => "ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE", + DeRolloutConditionCategory.RolloutFailureCategoryRoutingError => "ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR", + DeRolloutConditionCategory.RolloutFailureCategorySourceNotDrained => "ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED", + DeRolloutConditionCategory.RolloutFailureCategoryTargetNotReady => "ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY", + DeRolloutConditionCategory.RolloutFailureCategoryUnderServed => "ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRolloutConditionCategory? ToEnum(string value) + { + return value switch + { + "ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR" => DeRolloutConditionCategory.RolloutFailureCategoryAbortedByOperator, + "ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED" => DeRolloutConditionCategory.RolloutFailureCategoryCapacityExhausted, + "ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE" => DeRolloutConditionCategory.RolloutFailureCategoryDependencyOutage, + "ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED" => DeRolloutConditionCategory.RolloutFailureCategoryEntitlementLapsed, + "ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION" => DeRolloutConditionCategory.RolloutFailureCategoryHealthRegression, + "ROLLOUT_FAILURE_CATEGORY_INTERNAL" => DeRolloutConditionCategory.RolloutFailureCategoryInternal, + "ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE" => DeRolloutConditionCategory.RolloutFailureCategoryMetricsUnavailable, + "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION" => DeRolloutConditionCategory.RolloutFailureCategoryMetricRegression, + "ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE" => DeRolloutConditionCategory.RolloutFailureCategoryPolicyInfeasible, + "ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR" => DeRolloutConditionCategory.RolloutFailureCategoryRoutingError, + "ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED" => DeRolloutConditionCategory.RolloutFailureCategorySourceNotDrained, + "ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY" => DeRolloutConditionCategory.RolloutFailureCategoryTargetNotReady, + "ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED" => DeRolloutConditionCategory.RolloutFailureCategoryUnderServed, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutState.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutState.g.cs new file mode 100644 index 00000000..ef41c419 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutState.g.cs @@ -0,0 +1,100 @@ + +#nullable enable + +namespace Together +{ + /// + /// Output only. High-level rollout lifecycle state.
+ /// Included only in responses + ///
+ public enum DeRolloutState + { + /// + /// + /// + RolloutStateAborted, + /// + /// + /// + RolloutStateAborting, + /// + /// + /// + RolloutStateCanceled, + /// + /// + /// + RolloutStateCancelling, + /// + /// + /// + RolloutStateCompleted, + /// + /// + /// + RolloutStatePaused, + /// + /// + /// + RolloutStatePending, + /// + /// + /// + RolloutStateRunning, + /// + /// + /// + RolloutStateStabilizing, + /// + /// + /// + RolloutStateSystemPaused, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRolloutStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRolloutState value) + { + return value switch + { + DeRolloutState.RolloutStateAborted => "ROLLOUT_STATE_ABORTED", + DeRolloutState.RolloutStateAborting => "ROLLOUT_STATE_ABORTING", + DeRolloutState.RolloutStateCanceled => "ROLLOUT_STATE_CANCELED", + DeRolloutState.RolloutStateCancelling => "ROLLOUT_STATE_CANCELLING", + DeRolloutState.RolloutStateCompleted => "ROLLOUT_STATE_COMPLETED", + DeRolloutState.RolloutStatePaused => "ROLLOUT_STATE_PAUSED", + DeRolloutState.RolloutStatePending => "ROLLOUT_STATE_PENDING", + DeRolloutState.RolloutStateRunning => "ROLLOUT_STATE_RUNNING", + DeRolloutState.RolloutStateStabilizing => "ROLLOUT_STATE_STABILIZING", + DeRolloutState.RolloutStateSystemPaused => "ROLLOUT_STATE_SYSTEM_PAUSED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRolloutState? ToEnum(string value) + { + return value switch + { + "ROLLOUT_STATE_ABORTED" => DeRolloutState.RolloutStateAborted, + "ROLLOUT_STATE_ABORTING" => DeRolloutState.RolloutStateAborting, + "ROLLOUT_STATE_CANCELED" => DeRolloutState.RolloutStateCanceled, + "ROLLOUT_STATE_CANCELLING" => DeRolloutState.RolloutStateCancelling, + "ROLLOUT_STATE_COMPLETED" => DeRolloutState.RolloutStateCompleted, + "ROLLOUT_STATE_PAUSED" => DeRolloutState.RolloutStatePaused, + "ROLLOUT_STATE_PENDING" => DeRolloutState.RolloutStatePending, + "ROLLOUT_STATE_RUNNING" => DeRolloutState.RolloutStateRunning, + "ROLLOUT_STATE_STABILIZING" => DeRolloutState.RolloutStateStabilizing, + "ROLLOUT_STATE_SYSTEM_PAUSED" => DeRolloutState.RolloutStateSystemPaused, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStatus.Json.g.cs new file mode 100644 index 00000000..803dada4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRolloutStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRolloutStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRolloutStatus), + jsonSerializerContext) as global::Together.DeRolloutStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRolloutStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRolloutStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRolloutStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRolloutStatus; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStatus.g.cs new file mode 100644 index 00000000..fd6a7015 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStatus.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace Together +{ + /// + /// Derived runtime progress for a rollout. + /// + public sealed partial class DeRolloutStatus + { + /// + /// Total number of steps in the rollout progression. Always serializes when status is present. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalSteps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TotalSteps { get; set; } + + /// + /// Failure detail set when the rollout pauses, system-pauses, or aborts. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("condition")] + public global::Together.DeRolloutCondition? Condition { get; set; } + + /// + /// Per-step rollout execution summaries. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("steps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Steps { get; set; } + + /// + /// Timestamp of the most recent progress update. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Total number of steps in the rollout progression. Always serializes when status is present. + /// + /// + /// Per-step rollout execution summaries. + /// + /// + /// Failure detail set when the rollout pauses, system-pauses, or aborts. + /// + /// + /// Timestamp of the most recent progress update. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRolloutStatus( + int totalSteps, + global::System.Collections.Generic.IList steps, + global::Together.DeRolloutCondition? condition, + global::System.DateTime? updatedAt) + { + this.TotalSteps = totalSteps; + this.Condition = condition; + this.Steps = steps ?? throw new global::System.ArgumentNullException(nameof(steps)); + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRolloutStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStep.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStep.Json.g.cs new file mode 100644 index 00000000..b6968cf8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStep.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRolloutStep + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRolloutStep? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRolloutStep), + jsonSerializerContext) as global::Together.DeRolloutStep; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRolloutStep? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRolloutStep? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRolloutStep), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRolloutStep; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStep.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStep.g.cs new file mode 100644 index 00000000..b4c82c75 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStep.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// One stage of a canary rollout progression. + /// + public sealed partial class DeRolloutStep + { + /// + /// Required percentage of traffic on the target deployment for this step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("traffic")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Traffic { get; set; } + + /// + /// Optional explicit target replica count for this step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replicas")] + public int? Replicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required percentage of traffic on the target deployment for this step. + /// + /// + /// Optional explicit target replica count for this step. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRolloutStep( + int traffic, + int? replicas) + { + this.Traffic = traffic; + this.Replicas = replicas; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRolloutStep() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.Json.g.cs new file mode 100644 index 00000000..e147a799 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRolloutStepStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRolloutStepStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRolloutStepStatus), + jsonSerializerContext) as global::Together.DeRolloutStepStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRolloutStepStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRolloutStepStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRolloutStepStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRolloutStepStatus; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.g.cs new file mode 100644 index 00000000..bbea19cf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatus.g.cs @@ -0,0 +1,113 @@ + +#nullable enable + +namespace Together +{ + /// + /// Collapsed execution state for one rollout step. + /// + public sealed partial class DeRolloutStepStatus + { + /// + /// Index of this step in the rollout progression. Step 0 serializes explicitly. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stepIndex")] + public int? StepIndex { get; set; } + + /// + /// Target traffic percentage configured for this step. Always serializes for recorded steps. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetTrafficPercent")] + public int? TargetTrafficPercent { get; set; } + + /// + /// Execution state of this rollout step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter))] + public global::Together.DeRolloutStepStatusState? State { get; set; } + + /// + /// Metric gate results for this step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] + public global::System.Collections.Generic.IList? Metrics { get; set; } + + /// + /// Timestamp when this step started. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public global::System.DateTime? StartedAt { get; set; } + + /// + /// Timestamp when this step completed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("completedAt")] + public global::System.DateTime? CompletedAt { get; set; } + + /// + /// Failure reason when this step failed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("failureReason")] + public string? FailureReason { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Index of this step in the rollout progression. Step 0 serializes explicitly. + /// + /// + /// Target traffic percentage configured for this step. Always serializes for recorded steps. + /// + /// + /// Execution state of this rollout step. + /// + /// + /// Metric gate results for this step. + /// + /// + /// Timestamp when this step started. + /// + /// + /// Timestamp when this step completed. + /// + /// + /// Failure reason when this step failed. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRolloutStepStatus( + int? stepIndex, + int? targetTrafficPercent, + global::Together.DeRolloutStepStatusState? state, + global::System.Collections.Generic.IList? metrics, + global::System.DateTime? startedAt, + global::System.DateTime? completedAt, + string? failureReason) + { + this.StepIndex = stepIndex; + this.TargetTrafficPercent = targetTrafficPercent; + this.State = state; + this.Metrics = metrics; + this.StartedAt = startedAt; + this.CompletedAt = completedAt; + this.FailureReason = failureReason; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRolloutStepStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStepStatusState.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatusState.g.cs new file mode 100644 index 00000000..2afd7e71 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStepStatusState.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Execution state of this rollout step. + /// + public enum DeRolloutStepStatusState + { + /// + /// + /// + RolloutStepStateFailed, + /// + /// + /// + RolloutStepStatePassed, + /// + /// + /// + RolloutStepStatePending, + /// + /// + /// + RolloutStepStateRunning, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRolloutStepStatusStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRolloutStepStatusState value) + { + return value switch + { + DeRolloutStepStatusState.RolloutStepStateFailed => "ROLLOUT_STEP_STATE_FAILED", + DeRolloutStepStatusState.RolloutStepStatePassed => "ROLLOUT_STEP_STATE_PASSED", + DeRolloutStepStatusState.RolloutStepStatePending => "ROLLOUT_STEP_STATE_PENDING", + DeRolloutStepStatusState.RolloutStepStateRunning => "ROLLOUT_STEP_STATE_RUNNING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRolloutStepStatusState? ToEnum(string value) + { + return value switch + { + "ROLLOUT_STEP_STATE_FAILED" => DeRolloutStepStatusState.RolloutStepStateFailed, + "ROLLOUT_STEP_STATE_PASSED" => DeRolloutStepStatusState.RolloutStepStatePassed, + "ROLLOUT_STEP_STATE_PENDING" => DeRolloutStepStatusState.RolloutStepStatePending, + "ROLLOUT_STEP_STATE_RUNNING" => DeRolloutStepStatusState.RolloutStepStateRunning, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRolloutStrategy.g.cs b/src/libs/Together/Generated/Together.Models.DeRolloutStrategy.g.cs new file mode 100644 index 00000000..a14f9ca2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRolloutStrategy.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Output only. Rollout strategy selected at creation.
+ /// Included only in responses + ///
+ public enum DeRolloutStrategy + { + /// + /// + /// + RolloutStrategyTypeBlueGreen, + /// + /// + /// + RolloutStrategyTypeCanary, + /// + /// + /// + RolloutStrategyTypeRolling, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeRolloutStrategyExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeRolloutStrategy value) + { + return value switch + { + DeRolloutStrategy.RolloutStrategyTypeBlueGreen => "ROLLOUT_STRATEGY_TYPE_BLUE_GREEN", + DeRolloutStrategy.RolloutStrategyTypeCanary => "ROLLOUT_STRATEGY_TYPE_CANARY", + DeRolloutStrategy.RolloutStrategyTypeRolling => "ROLLOUT_STRATEGY_TYPE_ROLLING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeRolloutStrategy? ToEnum(string value) + { + return value switch + { + "ROLLOUT_STRATEGY_TYPE_BLUE_GREEN" => DeRolloutStrategy.RolloutStrategyTypeBlueGreen, + "ROLLOUT_STRATEGY_TYPE_CANARY" => DeRolloutStrategy.RolloutStrategyTypeCanary, + "ROLLOUT_STRATEGY_TYPE_ROLLING" => DeRolloutStrategy.RolloutStrategyTypeRolling, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.Json.g.cs new file mode 100644 index 00000000..c0d728a3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeRuntimeInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeRuntimeInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeRuntimeInfo), + jsonSerializerContext) as global::Together.DeRuntimeInfo; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeRuntimeInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeRuntimeInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeRuntimeInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeRuntimeInfo; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.g.cs b/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.g.cs new file mode 100644 index 00000000..553e57e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeRuntimeInfo.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace Together +{ + /// + /// Runtime information derived from the deployment's configuration. + /// + public sealed partial class DeRuntimeInfo + { + /// + /// Serving engine, such as `vllm`, `trtllm`, or `sglang`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("engineType")] + public string? EngineType { get; set; } + + /// + /// Version of the serving engine. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("engineVersion")] + public string? EngineVersion { get; set; } + + /// + /// Whether the runtime accepts tool and function-calling requests. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("functionCallingSupported")] + public bool? FunctionCallingSupported { get; set; } + + /// + /// Whether the runtime can constrain generation to a structured output schema. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("structuredOutputSupported")] + public bool? StructuredOutputSupported { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Serving engine, such as `vllm`, `trtllm`, or `sglang`. + /// + /// + /// Version of the serving engine. + /// + /// + /// Whether the runtime accepts tool and function-calling requests. + /// + /// + /// Whether the runtime can constrain generation to a structured output schema. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeRuntimeInfo( + string? engineType, + string? engineVersion, + bool? functionCallingSupported, + bool? structuredOutputSupported) + { + this.EngineType = engineType; + this.EngineVersion = engineVersion; + this.FunctionCallingSupported = functionCallingSupported; + this.StructuredOutputSupported = structuredOutputSupported; + } + + /// + /// Initializes a new instance of the class. + /// + public DeRuntimeInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeScalingMetric.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeScalingMetric.Json.g.cs new file mode 100644 index 00000000..4fa99506 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeScalingMetric.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeScalingMetric + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeScalingMetric? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeScalingMetric), + jsonSerializerContext) as global::Together.DeScalingMetric; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeScalingMetric? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeScalingMetric? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeScalingMetric), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeScalingMetric; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeScalingMetric.g.cs b/src/libs/Together/Generated/Together.Models.DeScalingMetric.g.cs new file mode 100644 index 00000000..aea5a6eb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeScalingMetric.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace Together +{ + /// + /// Metric and target used by the autoscaler to recommend a replica count. + /// + public sealed partial class DeScalingMetric + { + /// + /// Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`, `e2e_latency`, `throughput_per_replica`, or `decoding_speed`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Whether `target` is an absolute value, a utilization percentage, or a per-replica average. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeScalingMetricTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeScalingMetricType Type { get; set; } + + /// + /// Target interpreted according to `type`. Utilization uses a percentage from 0 to 100, value uses an absolute measurement, and average value uses a per-replica measurement. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Target { get; set; } + + /// + /// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("percentile")] + public string? Percentile { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`, `e2e_latency`, `throughput_per_replica`, or `decoding_speed`. + /// + /// + /// Whether `target` is an absolute value, a utilization percentage, or a per-replica average. + /// + /// + /// Target interpreted according to `type`. Utilization uses a percentage from 0 to 100, value uses an absolute measurement, and average value uses a per-replica measurement. + /// + /// + /// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeScalingMetric( + string name, + global::Together.DeScalingMetricType type, + double target, + string? percentile) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Type = type; + this.Target = target; + this.Percentile = percentile; + } + + /// + /// Initializes a new instance of the class. + /// + public DeScalingMetric() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeScalingMetricType.g.cs b/src/libs/Together/Generated/Together.Models.DeScalingMetricType.g.cs new file mode 100644 index 00000000..4b0bfdc0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeScalingMetricType.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether `target` is an absolute value, a utilization percentage, or a per-replica average. + /// + public enum DeScalingMetricType + { + /// + /// + /// + MetricTargetTypeAverageValue, + /// + /// + /// + MetricTargetTypeUtilization, + /// + /// + /// + MetricTargetTypeValue, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeScalingMetricTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeScalingMetricType value) + { + return value switch + { + DeScalingMetricType.MetricTargetTypeAverageValue => "METRIC_TARGET_TYPE_AVERAGE_VALUE", + DeScalingMetricType.MetricTargetTypeUtilization => "METRIC_TARGET_TYPE_UTILIZATION", + DeScalingMetricType.MetricTargetTypeValue => "METRIC_TARGET_TYPE_VALUE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeScalingMetricType? ToEnum(string value) + { + return value switch + { + "METRIC_TARGET_TYPE_AVERAGE_VALUE" => DeScalingMetricType.MetricTargetTypeAverageValue, + "METRIC_TARGET_TYPE_UTILIZATION" => DeScalingMetricType.MetricTargetTypeUtilization, + "METRIC_TARGET_TYPE_VALUE" => DeScalingMetricType.MetricTargetTypeValue, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSelector.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeSelector.Json.g.cs new file mode 100644 index 00000000..379487ff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSelector.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeSelector + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeSelector? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeSelector), + jsonSerializerContext) as global::Together.DeSelector; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeSelector? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeSelector? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeSelector), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeSelector; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeSelector.g.cs b/src/libs/Together/Generated/Together.Models.DeSelector.g.cs new file mode 100644 index 00000000..775c0547 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSelector.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Hardware or runtime requirement expressed as a key-value pair. + /// + public sealed partial class DeSelector + { + /// + /// Selector name, such as GPU type, GPU count, or optimization profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// Required value for the selector. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Selector name, such as GPU type, GPU count, or optimization profile. + /// + /// + /// Required value for the selector. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeSelector( + string key, + string value) + { + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeSelector() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperiment.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperiment.Json.g.cs new file mode 100644 index 00000000..087e19a0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperiment.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperiment + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperiment? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperiment), + jsonSerializerContext) as global::Together.DeShadowExperiment; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperiment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperiment? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperiment), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperiment; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperiment.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperiment.g.cs new file mode 100644 index 00000000..6d2cdcc1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperiment.g.cs @@ -0,0 +1,193 @@ + +#nullable enable + +namespace Together +{ + /// + /// Experiment that mirrors sampled endpoint requests to target deployments without changing client responses. + /// + public sealed partial class DeShadowExperiment + { + /// + /// Output only. Unique shadow experiment identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// Output only. Project that owns the parent endpoint.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + public string ProjectId { get; set; } = default!; + + /// + /// Output only. Endpoint whose traffic this experiment samples.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("endpointId")] + public string EndpointId { get; set; } = default!; + + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// User defined description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Endpoint source and sampling configuration for mirrored requests. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentSourceResponse Source { get; set; } + + /// + /// Target deployments that receive mirrored traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targets")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Targets { get; set; } + + /// + /// Identifier of the principal that created the experiment.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdBy")] + public string CreatedBy { get; set; } = default!; + + /// + /// Timestamp when the experiment was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Timestamp when the experiment was last updated.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime UpdatedAt { get; set; } = default!; + + /// + /// Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Derived serving state, active when the experiment has at least one target.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeShadowExperimentStateJsonConverter))] + public global::Together.DeShadowExperimentState State { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + /// + /// Endpoint source and sampling configuration for mirrored requests. + /// + /// + /// Target deployments that receive mirrored traffic. + /// + /// + /// Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + /// + /// + /// User defined description. + /// + /// + /// Output only. Unique shadow experiment identifier.
+ /// Included only in responses + /// + /// + /// Output only. Project that owns the parent endpoint.
+ /// Included only in responses + /// + /// + /// Output only. Endpoint whose traffic this experiment samples.
+ /// Included only in responses + /// + /// + /// Identifier of the principal that created the experiment.
+ /// Included only in responses + /// + /// + /// Timestamp when the experiment was created.
+ /// Included only in responses + /// + /// + /// Timestamp when the experiment was last updated.
+ /// Included only in responses + /// + /// + /// Derived serving state, active when the experiment has at least one target.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperiment( + string name, + global::Together.DeShadowExperimentSourceResponse source, + global::System.Collections.Generic.IList targets, + string etag, + string? description, + string id = default!, + string projectId = default!, + string endpointId = default!, + string createdBy = default!, + global::System.DateTime createdAt = default!, + global::System.DateTime updatedAt = default!, + global::Together.DeShadowExperimentState state = default!) + { + this.Id = id; + this.ProjectId = projectId; + this.EndpointId = endpointId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.Targets = targets ?? throw new global::System.ArgumentNullException(nameof(targets)); + this.CreatedBy = createdBy; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + this.State = state; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperiment() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.Json.g.cs new file mode 100644 index 00000000..9fa70a54 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentAdaptiveKeyBasedSampling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSampling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSampling), + jsonSerializerContext) as global::Together.DeShadowExperimentAdaptiveKeyBasedSampling; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSampling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSampling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSampling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentAdaptiveKeyBasedSampling; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.g.cs new file mode 100644 index 00000000..83a24a71 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSampling.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Adaptive sticky-key sampling that throttles toward a target QPS. + /// + public sealed partial class DeShadowExperimentAdaptiveKeyBasedSampling + { + /// + /// Required per-gateway-replica target QPS for adaptive sampling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetQps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double TargetQps { get; set; } + + /// + /// Required request-body field used as the sticky sampling key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("window")] + public string? Window { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required per-gateway-replica target QPS for adaptive sampling. + /// + /// + /// Required request-body field used as the sticky sampling key. + /// + /// + /// Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentAdaptiveKeyBasedSampling( + double targetQps, + string key, + string? window) + { + this.TargetQps = targetQps; + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + this.Window = window; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentAdaptiveKeyBasedSampling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.Json.g.cs new file mode 100644 index 00000000..16e15c3c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentAdaptiveKeyBasedSamplingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.g.cs new file mode 100644 index 00000000..d91d235f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveKeyBasedSamplingResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Together +{ + /// + /// Adaptive sticky-key sampling returned by the API. + /// + public sealed partial class DeShadowExperimentAdaptiveKeyBasedSamplingResponse + { + /// + /// Per-gateway-replica target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetQps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double TargetQps { get; set; } + + /// + /// Request-body field used as the sticky sampling key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// Sliding window for QPS observation when explicitly configured. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("window")] + public string? Window { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-gateway-replica target QPS. + /// + /// + /// Request-body field used as the sticky sampling key. + /// + /// + /// Sliding window for QPS observation when explicitly configured. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentAdaptiveKeyBasedSamplingResponse( + double targetQps, + string key, + string? window) + { + this.TargetQps = targetQps; + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + this.Window = window; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentAdaptiveKeyBasedSamplingResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.Json.g.cs new file mode 100644 index 00000000..236fe8bb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentAdaptiveUniformSampling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveUniformSampling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentAdaptiveUniformSampling), + jsonSerializerContext) as global::Together.DeShadowExperimentAdaptiveUniformSampling; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveUniformSampling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentAdaptiveUniformSampling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentAdaptiveUniformSampling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentAdaptiveUniformSampling; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.g.cs new file mode 100644 index 00000000..a304aaa2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSampling.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Adaptive random sampling that throttles toward a target QPS. + /// + public sealed partial class DeShadowExperimentAdaptiveUniformSampling + { + /// + /// Required per-gateway-replica target QPS for adaptive sampling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetQps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double TargetQps { get; set; } + + /// + /// Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("window")] + public string? Window { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required per-gateway-replica target QPS for adaptive sampling. + /// + /// + /// Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentAdaptiveUniformSampling( + double targetQps, + string? window) + { + this.TargetQps = targetQps; + this.Window = window; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentAdaptiveUniformSampling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.Json.g.cs new file mode 100644 index 00000000..9a4ae3f1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentAdaptiveUniformSamplingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.g.cs new file mode 100644 index 00000000..cc54d0b2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentAdaptiveUniformSamplingResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Adaptive random sampling returned by the API. + /// + public sealed partial class DeShadowExperimentAdaptiveUniformSamplingResponse + { + /// + /// Per-gateway-replica target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetQps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double TargetQps { get; set; } + + /// + /// Sliding window for QPS observation when explicitly configured. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("window")] + public string? Window { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-gateway-replica target QPS. + /// + /// + /// Sliding window for QPS observation when explicitly configured. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentAdaptiveUniformSamplingResponse( + double targetQps, + string? window) + { + this.TargetQps = targetQps; + this.Window = window; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentAdaptiveUniformSamplingResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.Json.g.cs new file mode 100644 index 00000000..b41f8928 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentEndpointSource + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentEndpointSource? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentEndpointSource), + jsonSerializerContext) as global::Together.DeShadowExperimentEndpointSource; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentEndpointSource? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentEndpointSource? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentEndpointSource), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentEndpointSource; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.g.cs new file mode 100644 index 00000000..744eb611 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSource.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint-level source that samples endpoint traffic at the API gateway. + /// + public sealed partial class DeShadowExperimentEndpointSource + { + /// + /// Sampling strategy applied to endpoint traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sampling")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentSampling Sampling { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Sampling strategy applied to endpoint traffic. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentEndpointSource( + global::Together.DeShadowExperimentSampling sampling) + { + this.Sampling = sampling; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentEndpointSource() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.Json.g.cs new file mode 100644 index 00000000..70201c02 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentEndpointSourceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentEndpointSourceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentEndpointSourceResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentEndpointSourceResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentEndpointSourceResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentEndpointSourceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentEndpointSourceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentEndpointSourceResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.g.cs new file mode 100644 index 00000000..34954d6f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentEndpointSourceResponse.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint-level source returned for a shadow experiment. + /// + public sealed partial class DeShadowExperimentEndpointSourceResponse + { + /// + /// Resolved sampling strategy applied to endpoint traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sampling")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentSamplingResponse Sampling { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Resolved sampling strategy applied to endpoint traffic. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentEndpointSourceResponse( + global::Together.DeShadowExperimentSamplingResponse sampling) + { + this.Sampling = sampling; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentEndpointSourceResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.Json.g.cs new file mode 100644 index 00000000..9bc53427 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentKeyBasedSampling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentKeyBasedSampling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentKeyBasedSampling), + jsonSerializerContext) as global::Together.DeShadowExperimentKeyBasedSampling; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentKeyBasedSampling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentKeyBasedSampling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentKeyBasedSampling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentKeyBasedSampling; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.g.cs new file mode 100644 index 00000000..c899d895 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSampling.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Fixed-rate sampling of distinct key values with sticky decisions. + /// + public sealed partial class DeShadowExperimentKeyBasedSampling + { + /// + /// Required fraction of distinct key values to sample, from 0.0 to 1.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Rate { get; set; } + + /// + /// Required request-body field used as the sticky sampling key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required fraction of distinct key values to sample, from 0.0 to 1.0. + /// + /// + /// Required request-body field used as the sticky sampling key. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentKeyBasedSampling( + double rate, + string key) + { + this.Rate = rate; + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentKeyBasedSampling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.Json.g.cs new file mode 100644 index 00000000..044e1564 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentKeyBasedSamplingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentKeyBasedSamplingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentKeyBasedSamplingResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentKeyBasedSamplingResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentKeyBasedSamplingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentKeyBasedSamplingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentKeyBasedSamplingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentKeyBasedSamplingResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.g.cs new file mode 100644 index 00000000..0cb16590 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentKeyBasedSamplingResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted by JSON serialization. + /// + public sealed partial class DeShadowExperimentKeyBasedSamplingResponse + { + /// + /// Fraction of distinct key values sampled, from 0.0 to 1.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate")] + public double? Rate { get; set; } + + /// + /// Request-body field used as the sticky sampling key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Request-body field used as the sticky sampling key. + /// + /// + /// Fraction of distinct key values sampled, from 0.0 to 1.0. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentKeyBasedSamplingResponse( + string key, + double? rate) + { + this.Rate = rate; + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentKeyBasedSamplingResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.Json.g.cs new file mode 100644 index 00000000..f59435aa --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct DeShadowExperimentSampling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSampling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSampling), + jsonSerializerContext) as global::Together.DeShadowExperimentSampling?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSampling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSampling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSampling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSampling?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.g.cs new file mode 100644 index 00000000..8877d94f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSampling.g.cs @@ -0,0 +1,461 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// Sampling strategy for endpoint-level shadow traffic. Exactly one strategy must be set. + /// + public readonly partial struct DeShadowExperimentSampling : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingVariant1? DeShadowExperimentSamplingVariant1 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingVariant1? DeShadowExperimentSamplingVariant1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingVariant1))] +#endif + public bool IsDeShadowExperimentSamplingVariant1 => DeShadowExperimentSamplingVariant1 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingVariant1? value) + { + value = DeShadowExperimentSamplingVariant1; + return IsDeShadowExperimentSamplingVariant1; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingVariant1 PickDeShadowExperimentSamplingVariant1() => IsDeShadowExperimentSamplingVariant1 + ? DeShadowExperimentSamplingVariant1! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingVariant1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingVariant2? DeShadowExperimentSamplingVariant2 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingVariant2? DeShadowExperimentSamplingVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingVariant2))] +#endif + public bool IsDeShadowExperimentSamplingVariant2 => DeShadowExperimentSamplingVariant2 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingVariant2? value) + { + value = DeShadowExperimentSamplingVariant2; + return IsDeShadowExperimentSamplingVariant2; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingVariant2 PickDeShadowExperimentSamplingVariant2() => IsDeShadowExperimentSamplingVariant2 + ? DeShadowExperimentSamplingVariant2! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingVariant2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingVariant3? DeShadowExperimentSamplingVariant3 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingVariant3? DeShadowExperimentSamplingVariant3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingVariant3))] +#endif + public bool IsDeShadowExperimentSamplingVariant3 => DeShadowExperimentSamplingVariant3 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingVariant3? value) + { + value = DeShadowExperimentSamplingVariant3; + return IsDeShadowExperimentSamplingVariant3; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingVariant3 PickDeShadowExperimentSamplingVariant3() => IsDeShadowExperimentSamplingVariant3 + ? DeShadowExperimentSamplingVariant3! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingVariant3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingVariant4? DeShadowExperimentSamplingVariant4 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingVariant4? DeShadowExperimentSamplingVariant4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingVariant4))] +#endif + public bool IsDeShadowExperimentSamplingVariant4 => DeShadowExperimentSamplingVariant4 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingVariant4? value) + { + value = DeShadowExperimentSamplingVariant4; + return IsDeShadowExperimentSamplingVariant4; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingVariant4 PickDeShadowExperimentSamplingVariant4() => IsDeShadowExperimentSamplingVariant4 + ? DeShadowExperimentSamplingVariant4! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingVariant4' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant1 value) => new DeShadowExperimentSampling((global::Together.DeShadowExperimentSamplingVariant1?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingVariant1?(DeShadowExperimentSampling @this) => @this.DeShadowExperimentSamplingVariant1; + + /// + /// + /// + public DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant1? value) + { + DeShadowExperimentSamplingVariant1 = value; + } + + /// + /// + /// + public static DeShadowExperimentSampling FromDeShadowExperimentSamplingVariant1(global::Together.DeShadowExperimentSamplingVariant1? value) => new DeShadowExperimentSampling(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant2 value) => new DeShadowExperimentSampling((global::Together.DeShadowExperimentSamplingVariant2?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingVariant2?(DeShadowExperimentSampling @this) => @this.DeShadowExperimentSamplingVariant2; + + /// + /// + /// + public DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant2? value) + { + DeShadowExperimentSamplingVariant2 = value; + } + + /// + /// + /// + public static DeShadowExperimentSampling FromDeShadowExperimentSamplingVariant2(global::Together.DeShadowExperimentSamplingVariant2? value) => new DeShadowExperimentSampling(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant3 value) => new DeShadowExperimentSampling((global::Together.DeShadowExperimentSamplingVariant3?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingVariant3?(DeShadowExperimentSampling @this) => @this.DeShadowExperimentSamplingVariant3; + + /// + /// + /// + public DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant3? value) + { + DeShadowExperimentSamplingVariant3 = value; + } + + /// + /// + /// + public static DeShadowExperimentSampling FromDeShadowExperimentSamplingVariant3(global::Together.DeShadowExperimentSamplingVariant3? value) => new DeShadowExperimentSampling(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant4 value) => new DeShadowExperimentSampling((global::Together.DeShadowExperimentSamplingVariant4?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingVariant4?(DeShadowExperimentSampling @this) => @this.DeShadowExperimentSamplingVariant4; + + /// + /// + /// + public DeShadowExperimentSampling(global::Together.DeShadowExperimentSamplingVariant4? value) + { + DeShadowExperimentSamplingVariant4 = value; + } + + /// + /// + /// + public static DeShadowExperimentSampling FromDeShadowExperimentSamplingVariant4(global::Together.DeShadowExperimentSamplingVariant4? value) => new DeShadowExperimentSampling(value); + + /// + /// + /// + public DeShadowExperimentSampling( + global::Together.DeShadowExperimentSamplingVariant1? deShadowExperimentSamplingVariant1, + global::Together.DeShadowExperimentSamplingVariant2? deShadowExperimentSamplingVariant2, + global::Together.DeShadowExperimentSamplingVariant3? deShadowExperimentSamplingVariant3, + global::Together.DeShadowExperimentSamplingVariant4? deShadowExperimentSamplingVariant4 + ) + { + DeShadowExperimentSamplingVariant1 = deShadowExperimentSamplingVariant1; + DeShadowExperimentSamplingVariant2 = deShadowExperimentSamplingVariant2; + DeShadowExperimentSamplingVariant3 = deShadowExperimentSamplingVariant3; + DeShadowExperimentSamplingVariant4 = deShadowExperimentSamplingVariant4; + } + + /// + /// + /// + public object? Object => + DeShadowExperimentSamplingVariant4 as object ?? + DeShadowExperimentSamplingVariant3 as object ?? + DeShadowExperimentSamplingVariant2 as object ?? + DeShadowExperimentSamplingVariant1 as object + ; + + /// + /// + /// + public override string? ToString() => + DeShadowExperimentSamplingVariant1?.ToString() ?? + DeShadowExperimentSamplingVariant2?.ToString() ?? + DeShadowExperimentSamplingVariant3?.ToString() ?? + DeShadowExperimentSamplingVariant4?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsDeShadowExperimentSamplingVariant1 && !IsDeShadowExperimentSamplingVariant2 && !IsDeShadowExperimentSamplingVariant3 && !IsDeShadowExperimentSamplingVariant4 || !IsDeShadowExperimentSamplingVariant1 && IsDeShadowExperimentSamplingVariant2 && !IsDeShadowExperimentSamplingVariant3 && !IsDeShadowExperimentSamplingVariant4 || !IsDeShadowExperimentSamplingVariant1 && !IsDeShadowExperimentSamplingVariant2 && IsDeShadowExperimentSamplingVariant3 && !IsDeShadowExperimentSamplingVariant4 || !IsDeShadowExperimentSamplingVariant1 && !IsDeShadowExperimentSamplingVariant2 && !IsDeShadowExperimentSamplingVariant3 && IsDeShadowExperimentSamplingVariant4; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? deShadowExperimentSamplingVariant1 = null, + global::System.Func? deShadowExperimentSamplingVariant2 = null, + global::System.Func? deShadowExperimentSamplingVariant3 = null, + global::System.Func? deShadowExperimentSamplingVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingVariant1 && deShadowExperimentSamplingVariant1 != null) + { + return deShadowExperimentSamplingVariant1(DeShadowExperimentSamplingVariant1!); + } + else if (IsDeShadowExperimentSamplingVariant2 && deShadowExperimentSamplingVariant2 != null) + { + return deShadowExperimentSamplingVariant2(DeShadowExperimentSamplingVariant2!); + } + else if (IsDeShadowExperimentSamplingVariant3 && deShadowExperimentSamplingVariant3 != null) + { + return deShadowExperimentSamplingVariant3(DeShadowExperimentSamplingVariant3!); + } + else if (IsDeShadowExperimentSamplingVariant4 && deShadowExperimentSamplingVariant4 != null) + { + return deShadowExperimentSamplingVariant4(DeShadowExperimentSamplingVariant4!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? deShadowExperimentSamplingVariant1 = null, + + global::System.Action? deShadowExperimentSamplingVariant2 = null, + + global::System.Action? deShadowExperimentSamplingVariant3 = null, + + global::System.Action? deShadowExperimentSamplingVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingVariant1) + { + deShadowExperimentSamplingVariant1?.Invoke(DeShadowExperimentSamplingVariant1!); + } + else if (IsDeShadowExperimentSamplingVariant2) + { + deShadowExperimentSamplingVariant2?.Invoke(DeShadowExperimentSamplingVariant2!); + } + else if (IsDeShadowExperimentSamplingVariant3) + { + deShadowExperimentSamplingVariant3?.Invoke(DeShadowExperimentSamplingVariant3!); + } + else if (IsDeShadowExperimentSamplingVariant4) + { + deShadowExperimentSamplingVariant4?.Invoke(DeShadowExperimentSamplingVariant4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? deShadowExperimentSamplingVariant1 = null, + global::System.Action? deShadowExperimentSamplingVariant2 = null, + global::System.Action? deShadowExperimentSamplingVariant3 = null, + global::System.Action? deShadowExperimentSamplingVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingVariant1) + { + deShadowExperimentSamplingVariant1?.Invoke(DeShadowExperimentSamplingVariant1!); + } + else if (IsDeShadowExperimentSamplingVariant2) + { + deShadowExperimentSamplingVariant2?.Invoke(DeShadowExperimentSamplingVariant2!); + } + else if (IsDeShadowExperimentSamplingVariant3) + { + deShadowExperimentSamplingVariant3?.Invoke(DeShadowExperimentSamplingVariant3!); + } + else if (IsDeShadowExperimentSamplingVariant4) + { + deShadowExperimentSamplingVariant4?.Invoke(DeShadowExperimentSamplingVariant4!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + DeShadowExperimentSamplingVariant1, + typeof(global::Together.DeShadowExperimentSamplingVariant1), + DeShadowExperimentSamplingVariant2, + typeof(global::Together.DeShadowExperimentSamplingVariant2), + DeShadowExperimentSamplingVariant3, + typeof(global::Together.DeShadowExperimentSamplingVariant3), + DeShadowExperimentSamplingVariant4, + typeof(global::Together.DeShadowExperimentSamplingVariant4), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(DeShadowExperimentSampling other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingVariant1, other.DeShadowExperimentSamplingVariant1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingVariant2, other.DeShadowExperimentSamplingVariant2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingVariant3, other.DeShadowExperimentSamplingVariant3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingVariant4, other.DeShadowExperimentSamplingVariant4) + ; + } + + /// + /// + /// + public static bool operator ==(DeShadowExperimentSampling obj1, DeShadowExperimentSampling obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(DeShadowExperimentSampling obj1, DeShadowExperimentSampling obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is DeShadowExperimentSampling o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.Json.g.cs new file mode 100644 index 00000000..62833b4d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct DeShadowExperimentSamplingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingResponse?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingResponse?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.g.cs new file mode 100644 index 00000000..5cef32eb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponse.g.cs @@ -0,0 +1,461 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// Sampling strategy returned for endpoint-level shadow traffic. + /// + public readonly partial struct DeShadowExperimentSamplingResponse : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingResponseVariant1? DeShadowExperimentSamplingResponseVariant1 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingResponseVariant1? DeShadowExperimentSamplingResponseVariant1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingResponseVariant1))] +#endif + public bool IsDeShadowExperimentSamplingResponseVariant1 => DeShadowExperimentSamplingResponseVariant1 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingResponseVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingResponseVariant1? value) + { + value = DeShadowExperimentSamplingResponseVariant1; + return IsDeShadowExperimentSamplingResponseVariant1; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingResponseVariant1 PickDeShadowExperimentSamplingResponseVariant1() => IsDeShadowExperimentSamplingResponseVariant1 + ? DeShadowExperimentSamplingResponseVariant1! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingResponseVariant1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingResponseVariant2? DeShadowExperimentSamplingResponseVariant2 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingResponseVariant2? DeShadowExperimentSamplingResponseVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingResponseVariant2))] +#endif + public bool IsDeShadowExperimentSamplingResponseVariant2 => DeShadowExperimentSamplingResponseVariant2 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingResponseVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingResponseVariant2? value) + { + value = DeShadowExperimentSamplingResponseVariant2; + return IsDeShadowExperimentSamplingResponseVariant2; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingResponseVariant2 PickDeShadowExperimentSamplingResponseVariant2() => IsDeShadowExperimentSamplingResponseVariant2 + ? DeShadowExperimentSamplingResponseVariant2! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingResponseVariant2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingResponseVariant3? DeShadowExperimentSamplingResponseVariant3 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingResponseVariant3? DeShadowExperimentSamplingResponseVariant3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingResponseVariant3))] +#endif + public bool IsDeShadowExperimentSamplingResponseVariant3 => DeShadowExperimentSamplingResponseVariant3 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingResponseVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingResponseVariant3? value) + { + value = DeShadowExperimentSamplingResponseVariant3; + return IsDeShadowExperimentSamplingResponseVariant3; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingResponseVariant3 PickDeShadowExperimentSamplingResponseVariant3() => IsDeShadowExperimentSamplingResponseVariant3 + ? DeShadowExperimentSamplingResponseVariant3! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingResponseVariant3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.DeShadowExperimentSamplingResponseVariant4? DeShadowExperimentSamplingResponseVariant4 { get; init; } +#else + public global::Together.DeShadowExperimentSamplingResponseVariant4? DeShadowExperimentSamplingResponseVariant4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DeShadowExperimentSamplingResponseVariant4))] +#endif + public bool IsDeShadowExperimentSamplingResponseVariant4 => DeShadowExperimentSamplingResponseVariant4 != null; + + /// + /// + /// + public bool TryPickDeShadowExperimentSamplingResponseVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.DeShadowExperimentSamplingResponseVariant4? value) + { + value = DeShadowExperimentSamplingResponseVariant4; + return IsDeShadowExperimentSamplingResponseVariant4; + } + + /// + /// + /// + public global::Together.DeShadowExperimentSamplingResponseVariant4 PickDeShadowExperimentSamplingResponseVariant4() => IsDeShadowExperimentSamplingResponseVariant4 + ? DeShadowExperimentSamplingResponseVariant4! + : throw new global::System.InvalidOperationException($"Expected union variant 'DeShadowExperimentSamplingResponseVariant4' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant1 value) => new DeShadowExperimentSamplingResponse((global::Together.DeShadowExperimentSamplingResponseVariant1?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingResponseVariant1?(DeShadowExperimentSamplingResponse @this) => @this.DeShadowExperimentSamplingResponseVariant1; + + /// + /// + /// + public DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant1? value) + { + DeShadowExperimentSamplingResponseVariant1 = value; + } + + /// + /// + /// + public static DeShadowExperimentSamplingResponse FromDeShadowExperimentSamplingResponseVariant1(global::Together.DeShadowExperimentSamplingResponseVariant1? value) => new DeShadowExperimentSamplingResponse(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant2 value) => new DeShadowExperimentSamplingResponse((global::Together.DeShadowExperimentSamplingResponseVariant2?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingResponseVariant2?(DeShadowExperimentSamplingResponse @this) => @this.DeShadowExperimentSamplingResponseVariant2; + + /// + /// + /// + public DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant2? value) + { + DeShadowExperimentSamplingResponseVariant2 = value; + } + + /// + /// + /// + public static DeShadowExperimentSamplingResponse FromDeShadowExperimentSamplingResponseVariant2(global::Together.DeShadowExperimentSamplingResponseVariant2? value) => new DeShadowExperimentSamplingResponse(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant3 value) => new DeShadowExperimentSamplingResponse((global::Together.DeShadowExperimentSamplingResponseVariant3?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingResponseVariant3?(DeShadowExperimentSamplingResponse @this) => @this.DeShadowExperimentSamplingResponseVariant3; + + /// + /// + /// + public DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant3? value) + { + DeShadowExperimentSamplingResponseVariant3 = value; + } + + /// + /// + /// + public static DeShadowExperimentSamplingResponse FromDeShadowExperimentSamplingResponseVariant3(global::Together.DeShadowExperimentSamplingResponseVariant3? value) => new DeShadowExperimentSamplingResponse(value); + + /// + /// + /// + public static implicit operator DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant4 value) => new DeShadowExperimentSamplingResponse((global::Together.DeShadowExperimentSamplingResponseVariant4?)value); + + /// + /// + /// + public static implicit operator global::Together.DeShadowExperimentSamplingResponseVariant4?(DeShadowExperimentSamplingResponse @this) => @this.DeShadowExperimentSamplingResponseVariant4; + + /// + /// + /// + public DeShadowExperimentSamplingResponse(global::Together.DeShadowExperimentSamplingResponseVariant4? value) + { + DeShadowExperimentSamplingResponseVariant4 = value; + } + + /// + /// + /// + public static DeShadowExperimentSamplingResponse FromDeShadowExperimentSamplingResponseVariant4(global::Together.DeShadowExperimentSamplingResponseVariant4? value) => new DeShadowExperimentSamplingResponse(value); + + /// + /// + /// + public DeShadowExperimentSamplingResponse( + global::Together.DeShadowExperimentSamplingResponseVariant1? deShadowExperimentSamplingResponseVariant1, + global::Together.DeShadowExperimentSamplingResponseVariant2? deShadowExperimentSamplingResponseVariant2, + global::Together.DeShadowExperimentSamplingResponseVariant3? deShadowExperimentSamplingResponseVariant3, + global::Together.DeShadowExperimentSamplingResponseVariant4? deShadowExperimentSamplingResponseVariant4 + ) + { + DeShadowExperimentSamplingResponseVariant1 = deShadowExperimentSamplingResponseVariant1; + DeShadowExperimentSamplingResponseVariant2 = deShadowExperimentSamplingResponseVariant2; + DeShadowExperimentSamplingResponseVariant3 = deShadowExperimentSamplingResponseVariant3; + DeShadowExperimentSamplingResponseVariant4 = deShadowExperimentSamplingResponseVariant4; + } + + /// + /// + /// + public object? Object => + DeShadowExperimentSamplingResponseVariant4 as object ?? + DeShadowExperimentSamplingResponseVariant3 as object ?? + DeShadowExperimentSamplingResponseVariant2 as object ?? + DeShadowExperimentSamplingResponseVariant1 as object + ; + + /// + /// + /// + public override string? ToString() => + DeShadowExperimentSamplingResponseVariant1?.ToString() ?? + DeShadowExperimentSamplingResponseVariant2?.ToString() ?? + DeShadowExperimentSamplingResponseVariant3?.ToString() ?? + DeShadowExperimentSamplingResponseVariant4?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsDeShadowExperimentSamplingResponseVariant1 && !IsDeShadowExperimentSamplingResponseVariant2 && !IsDeShadowExperimentSamplingResponseVariant3 && !IsDeShadowExperimentSamplingResponseVariant4 || !IsDeShadowExperimentSamplingResponseVariant1 && IsDeShadowExperimentSamplingResponseVariant2 && !IsDeShadowExperimentSamplingResponseVariant3 && !IsDeShadowExperimentSamplingResponseVariant4 || !IsDeShadowExperimentSamplingResponseVariant1 && !IsDeShadowExperimentSamplingResponseVariant2 && IsDeShadowExperimentSamplingResponseVariant3 && !IsDeShadowExperimentSamplingResponseVariant4 || !IsDeShadowExperimentSamplingResponseVariant1 && !IsDeShadowExperimentSamplingResponseVariant2 && !IsDeShadowExperimentSamplingResponseVariant3 && IsDeShadowExperimentSamplingResponseVariant4; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? deShadowExperimentSamplingResponseVariant1 = null, + global::System.Func? deShadowExperimentSamplingResponseVariant2 = null, + global::System.Func? deShadowExperimentSamplingResponseVariant3 = null, + global::System.Func? deShadowExperimentSamplingResponseVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingResponseVariant1 && deShadowExperimentSamplingResponseVariant1 != null) + { + return deShadowExperimentSamplingResponseVariant1(DeShadowExperimentSamplingResponseVariant1!); + } + else if (IsDeShadowExperimentSamplingResponseVariant2 && deShadowExperimentSamplingResponseVariant2 != null) + { + return deShadowExperimentSamplingResponseVariant2(DeShadowExperimentSamplingResponseVariant2!); + } + else if (IsDeShadowExperimentSamplingResponseVariant3 && deShadowExperimentSamplingResponseVariant3 != null) + { + return deShadowExperimentSamplingResponseVariant3(DeShadowExperimentSamplingResponseVariant3!); + } + else if (IsDeShadowExperimentSamplingResponseVariant4 && deShadowExperimentSamplingResponseVariant4 != null) + { + return deShadowExperimentSamplingResponseVariant4(DeShadowExperimentSamplingResponseVariant4!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? deShadowExperimentSamplingResponseVariant1 = null, + + global::System.Action? deShadowExperimentSamplingResponseVariant2 = null, + + global::System.Action? deShadowExperimentSamplingResponseVariant3 = null, + + global::System.Action? deShadowExperimentSamplingResponseVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingResponseVariant1) + { + deShadowExperimentSamplingResponseVariant1?.Invoke(DeShadowExperimentSamplingResponseVariant1!); + } + else if (IsDeShadowExperimentSamplingResponseVariant2) + { + deShadowExperimentSamplingResponseVariant2?.Invoke(DeShadowExperimentSamplingResponseVariant2!); + } + else if (IsDeShadowExperimentSamplingResponseVariant3) + { + deShadowExperimentSamplingResponseVariant3?.Invoke(DeShadowExperimentSamplingResponseVariant3!); + } + else if (IsDeShadowExperimentSamplingResponseVariant4) + { + deShadowExperimentSamplingResponseVariant4?.Invoke(DeShadowExperimentSamplingResponseVariant4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? deShadowExperimentSamplingResponseVariant1 = null, + global::System.Action? deShadowExperimentSamplingResponseVariant2 = null, + global::System.Action? deShadowExperimentSamplingResponseVariant3 = null, + global::System.Action? deShadowExperimentSamplingResponseVariant4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeShadowExperimentSamplingResponseVariant1) + { + deShadowExperimentSamplingResponseVariant1?.Invoke(DeShadowExperimentSamplingResponseVariant1!); + } + else if (IsDeShadowExperimentSamplingResponseVariant2) + { + deShadowExperimentSamplingResponseVariant2?.Invoke(DeShadowExperimentSamplingResponseVariant2!); + } + else if (IsDeShadowExperimentSamplingResponseVariant3) + { + deShadowExperimentSamplingResponseVariant3?.Invoke(DeShadowExperimentSamplingResponseVariant3!); + } + else if (IsDeShadowExperimentSamplingResponseVariant4) + { + deShadowExperimentSamplingResponseVariant4?.Invoke(DeShadowExperimentSamplingResponseVariant4!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + DeShadowExperimentSamplingResponseVariant1, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), + DeShadowExperimentSamplingResponseVariant2, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), + DeShadowExperimentSamplingResponseVariant3, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), + DeShadowExperimentSamplingResponseVariant4, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(DeShadowExperimentSamplingResponse other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingResponseVariant1, other.DeShadowExperimentSamplingResponseVariant1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingResponseVariant2, other.DeShadowExperimentSamplingResponseVariant2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingResponseVariant3, other.DeShadowExperimentSamplingResponseVariant3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DeShadowExperimentSamplingResponseVariant4, other.DeShadowExperimentSamplingResponseVariant4) + ; + } + + /// + /// + /// + public static bool operator ==(DeShadowExperimentSamplingResponse obj1, DeShadowExperimentSamplingResponse obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(DeShadowExperimentSamplingResponse obj1, DeShadowExperimentSamplingResponse obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is DeShadowExperimentSamplingResponse o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.Json.g.cs new file mode 100644 index 00000000..cec42628 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingResponseVariant1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingResponseVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingResponseVariant1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingResponseVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.g.cs new file mode 100644 index 00000000..955ae3a5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant1.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingResponseVariant1 + { + /// + /// Fixed random request sampling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uniform")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentUniformSamplingResponse Uniform { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fixed random request sampling. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingResponseVariant1( + global::Together.DeShadowExperimentUniformSamplingResponse uniform) + { + this.Uniform = uniform ?? throw new global::System.ArgumentNullException(nameof(uniform)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingResponseVariant1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.Json.g.cs new file mode 100644 index 00000000..cf825164 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingResponseVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingResponseVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingResponseVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingResponseVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.g.cs new file mode 100644 index 00000000..6e310243 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant2.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingResponseVariant2 + { + /// + /// Fixed sampling by a sticky request key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("keyBased")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentKeyBasedSamplingResponse KeyBased { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fixed sampling by a sticky request key. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingResponseVariant2( + global::Together.DeShadowExperimentKeyBasedSamplingResponse keyBased) + { + this.KeyBased = keyBased ?? throw new global::System.ArgumentNullException(nameof(keyBased)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingResponseVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.Json.g.cs new file mode 100644 index 00000000..b27c464a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingResponseVariant3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingResponseVariant3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingResponseVariant3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant3), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingResponseVariant3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.g.cs new file mode 100644 index 00000000..196a66ff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant3.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingResponseVariant3 + { + /// + /// Adaptive random sampling toward a target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adaptiveUniform")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse AdaptiveUniform { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adaptive random sampling toward a target QPS. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingResponseVariant3( + global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse adaptiveUniform) + { + this.AdaptiveUniform = adaptiveUniform ?? throw new global::System.ArgumentNullException(nameof(adaptiveUniform)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingResponseVariant3() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.Json.g.cs new file mode 100644 index 00000000..f32c95e6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingResponseVariant4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingResponseVariant4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingResponseVariant4? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingResponseVariant4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingResponseVariant4), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingResponseVariant4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.g.cs new file mode 100644 index 00000000..40c074e0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingResponseVariant4.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingResponseVariant4 + { + /// + /// Adaptive sticky-key sampling toward a target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adaptiveKeyBased")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse AdaptiveKeyBased { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adaptive sticky-key sampling toward a target QPS. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingResponseVariant4( + global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse adaptiveKeyBased) + { + this.AdaptiveKeyBased = adaptiveKeyBased ?? throw new global::System.ArgumentNullException(nameof(adaptiveKeyBased)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingResponseVariant4() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.Json.g.cs new file mode 100644 index 00000000..ac2cf42d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingVariant1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingVariant1), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingVariant1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.g.cs new file mode 100644 index 00000000..27c2424d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant1.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingVariant1 + { + /// + /// Fixed random request sampling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uniform")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentUniformSampling Uniform { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fixed random request sampling. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingVariant1( + global::Together.DeShadowExperimentUniformSampling uniform) + { + this.Uniform = uniform ?? throw new global::System.ArgumentNullException(nameof(uniform)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingVariant1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.Json.g.cs new file mode 100644 index 00000000..70cfd53d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingVariant2), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.g.cs new file mode 100644 index 00000000..ff1f9966 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant2.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingVariant2 + { + /// + /// Fixed sampling by a sticky request key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("keyBased")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentKeyBasedSampling KeyBased { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fixed sampling by a sticky request key. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingVariant2( + global::Together.DeShadowExperimentKeyBasedSampling keyBased) + { + this.KeyBased = keyBased ?? throw new global::System.ArgumentNullException(nameof(keyBased)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.Json.g.cs new file mode 100644 index 00000000..e3fa87f0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingVariant3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingVariant3), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingVariant3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingVariant3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingVariant3), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingVariant3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.g.cs new file mode 100644 index 00000000..a293d438 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant3.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingVariant3 + { + /// + /// Adaptive random sampling toward a target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adaptiveUniform")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentAdaptiveUniformSampling AdaptiveUniform { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adaptive random sampling toward a target QPS. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingVariant3( + global::Together.DeShadowExperimentAdaptiveUniformSampling adaptiveUniform) + { + this.AdaptiveUniform = adaptiveUniform ?? throw new global::System.ArgumentNullException(nameof(adaptiveUniform)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingVariant3() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.Json.g.cs new file mode 100644 index 00000000..0baab5c9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSamplingVariant4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSamplingVariant4), + jsonSerializerContext) as global::Together.DeShadowExperimentSamplingVariant4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSamplingVariant4? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSamplingVariant4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSamplingVariant4), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSamplingVariant4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.g.cs new file mode 100644 index 00000000..983d7e81 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSamplingVariant4.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DeShadowExperimentSamplingVariant4 + { + /// + /// Adaptive sticky-key sampling toward a target QPS. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adaptiveKeyBased")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentAdaptiveKeyBasedSampling AdaptiveKeyBased { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Adaptive sticky-key sampling toward a target QPS. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSamplingVariant4( + global::Together.DeShadowExperimentAdaptiveKeyBasedSampling adaptiveKeyBased) + { + this.AdaptiveKeyBased = adaptiveKeyBased ?? throw new global::System.ArgumentNullException(nameof(adaptiveKeyBased)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSamplingVariant4() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.Json.g.cs new file mode 100644 index 00000000..2c1e148a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSource + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSource? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSource), + jsonSerializerContext) as global::Together.DeShadowExperimentSource; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSource? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSource? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSource), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSource; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.g.cs new file mode 100644 index 00000000..d09eb15c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSource.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Traffic source for a shadow experiment. The public API supports endpoint sources only. + /// + public sealed partial class DeShadowExperimentSource + { + /// + /// Endpoint-level source that samples traffic at the API gateway. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentEndpointSource Endpoint { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Endpoint-level source that samples traffic at the API gateway. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSource( + global::Together.DeShadowExperimentEndpointSource endpoint) + { + this.Endpoint = endpoint ?? throw new global::System.ArgumentNullException(nameof(endpoint)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSource() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.Json.g.cs new file mode 100644 index 00000000..3d47e86c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentSourceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSourceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentSourceResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentSourceResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentSourceResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentSourceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentSourceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentSourceResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.g.cs new file mode 100644 index 00000000..67f50183 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentSourceResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Endpoint traffic source returned for a shadow experiment. + /// + public sealed partial class DeShadowExperimentSourceResponse + { + /// + /// Endpoint-level source that samples traffic at the API gateway. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeShadowExperimentEndpointSourceResponse Endpoint { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Endpoint-level source that samples traffic at the API gateway. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentSourceResponse( + global::Together.DeShadowExperimentEndpointSourceResponse endpoint) + { + this.Endpoint = endpoint ?? throw new global::System.ArgumentNullException(nameof(endpoint)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentSourceResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentState.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentState.g.cs new file mode 100644 index 00000000..67f8db97 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentState.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Derived serving state, active when the experiment has at least one target.
+ /// Included only in responses + ///
+ public enum DeShadowExperimentState + { + /// + /// + /// + ShadowExperimentStateActive, + /// + /// + /// + ShadowExperimentStateInactive, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeShadowExperimentStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeShadowExperimentState value) + { + return value switch + { + DeShadowExperimentState.ShadowExperimentStateActive => "SHADOW_EXPERIMENT_STATE_ACTIVE", + DeShadowExperimentState.ShadowExperimentStateInactive => "SHADOW_EXPERIMENT_STATE_INACTIVE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeShadowExperimentState? ToEnum(string value) + { + return value switch + { + "SHADOW_EXPERIMENT_STATE_ACTIVE" => DeShadowExperimentState.ShadowExperimentStateActive, + "SHADOW_EXPERIMENT_STATE_INACTIVE" => DeShadowExperimentState.ShadowExperimentStateInactive, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.Json.g.cs new file mode 100644 index 00000000..c3691acf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentTarget + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentTarget? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentTarget), + jsonSerializerContext) as global::Together.DeShadowExperimentTarget; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentTarget? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentTarget? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentTarget), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentTarget; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.g.cs new file mode 100644 index 00000000..add8bac0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentTarget.g.cs @@ -0,0 +1,138 @@ + +#nullable enable + +namespace Together +{ + /// + /// Deployment that receives mirrored traffic for a shadow experiment. + /// + public sealed partial class DeShadowExperimentTarget + { + /// + /// Output only. Unique shadow experiment target identifier.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = default!; + + /// + /// Output only. Shadow experiment this target belongs to.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("experimentId")] + public string ExperimentId { get; set; } = default!; + + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Shadow targets should be excluded from the endpoint's live traffic split. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetDeploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TargetDeploymentId { get; set; } + + /// + /// Optional free-form target description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Output only. Timestamp when the target was created.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + public global::System.DateTime CreatedAt { get; set; } = default!; + + /// + /// Output only. Timestamp when the target was last updated.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + public global::System.DateTime UpdatedAt { get; set; } = default!; + + /// + /// Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Shadow targets should be excluded from the endpoint's live traffic split. + /// + /// + /// Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + /// + /// + /// Optional free-form target description. + /// + /// + /// Output only. Unique shadow experiment target identifier.
+ /// Included only in responses + /// + /// + /// Output only. Shadow experiment this target belongs to.
+ /// Included only in responses + /// + /// + /// Output only. Timestamp when the target was created.
+ /// Included only in responses + /// + /// + /// Output only. Timestamp when the target was last updated.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentTarget( + string name, + string targetDeploymentId, + string etag, + string? description, + string id = default!, + string experimentId = default!, + global::System.DateTime createdAt = default!, + global::System.DateTime updatedAt = default!) + { + this.Id = id; + this.ExperimentId = experimentId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.TargetDeploymentId = targetDeploymentId ?? throw new global::System.ArgumentNullException(nameof(targetDeploymentId)); + this.Description = description; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentTarget() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.Json.g.cs new file mode 100644 index 00000000..a6283523 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentUniformSampling + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentUniformSampling? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentUniformSampling), + jsonSerializerContext) as global::Together.DeShadowExperimentUniformSampling; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentUniformSampling? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentUniformSampling? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentUniformSampling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentUniformSampling; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.g.cs new file mode 100644 index 00000000..ed4f184c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSampling.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Fixed-rate random sampling of endpoint requests. + /// + public sealed partial class DeShadowExperimentUniformSampling + { + /// + /// Required fraction of requests to sample, from 0.0 to 1.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Rate { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required fraction of requests to sample, from 0.0 to 1.0. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentUniformSampling( + double rate) + { + this.Rate = rate; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentUniformSampling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.Json.g.cs new file mode 100644 index 00000000..ad849e1f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeShadowExperimentUniformSamplingResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentUniformSamplingResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeShadowExperimentUniformSamplingResponse), + jsonSerializerContext) as global::Together.DeShadowExperimentUniformSamplingResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeShadowExperimentUniformSamplingResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeShadowExperimentUniformSamplingResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeShadowExperimentUniformSamplingResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeShadowExperimentUniformSamplingResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.g.cs b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.g.cs new file mode 100644 index 00000000..9056960f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeShadowExperimentUniformSamplingResponse.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Fixed-rate random sampling returned by the API. A zero rate may be omitted by JSON serialization. + /// + public sealed partial class DeShadowExperimentUniformSamplingResponse + { + /// + /// Fraction of requests sampled, from 0.0 to 1.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate")] + public double? Rate { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fraction of requests sampled, from 0.0 to 1.0. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeShadowExperimentUniformSamplingResponse( + double? rate) + { + this.Rate = rate; + } + + /// + /// Initializes a new instance of the class. + /// + public DeShadowExperimentUniformSamplingResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModel.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModel.Json.g.cs new file mode 100644 index 00000000..12d8afd7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModel.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeSupportedModel + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeSupportedModel? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeSupportedModel), + jsonSerializerContext) as global::Together.DeSupportedModel; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeSupportedModel? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeSupportedModel? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeSupportedModel), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeSupportedModel; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModel.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModel.g.cs new file mode 100644 index 00000000..6a6a399e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModel.g.cs @@ -0,0 +1,315 @@ + +#nullable enable + +namespace Together +{ + /// + /// Curated catalog entry for a platform-supported model. + /// + public sealed partial class DeSupportedModel + { + /// + /// Unique ID of the deployable Together-hosted base model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Catalog-controlled HF model ID used for inference. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Catalog-controlled human-readable model name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// Human-readable model description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Input modalities supported by the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inputModalities")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList InputModalities { get; set; } + + /// + /// Output modalities produced by the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("outputModalities")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList OutputModalities { get; set; } + + /// + /// Product surfaces where the model is offered. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("products")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Products { get; set; } + + /// + /// Advanced features exposed by the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("features")] + public global::System.Collections.Generic.IList? Features { get; set; } + + /// + /// High-level tasks the model supports. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("capabilities")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Capabilities { get; set; } + + /// + /// Model architecture from the underlying weights metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("architecture")] + public string? Architecture { get; set; } + + /// + /// Maximum context length from the underlying weights metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contextLength")] + public string? ContextLength { get; set; } + + /// + /// Organization or publisher associated with the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("publisher")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Publisher { get; set; } + + /// + /// Catalog recommendation status for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeSupportedModelStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeSupportedModelStatus Status { get; set; } + + /// + /// Searchable catalog tags for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tags")] + public global::System.Collections.Generic.IList? Tags { get; set; } + + /// + /// Preferred input format for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("inputFormat")] + public string? InputFormat { get; set; } + + /// + /// Preferred output format for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("outputFormat")] + public string? OutputFormat { get; set; } + + /// + /// Serverless endpoint name for inference, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("serverlessEndpoint")] + public string? ServerlessEndpoint { get; set; } + + /// + /// Model family identifier for related catalog entries. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("familyId")] + public string? FamilyId { get; set; } + + /// + /// UI-facing model type badge, such as chat, language, code, image, embedding, rerank, moderation, audio, video, or transcribe. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayType { get; set; } + + /// + /// Bare model ID for the architecture's base model; empty when no base model is linked. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("baseModelId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModelId { get; set; } + + /// + /// Resource name for the base model as `projects/{projectId}/models/{modelId}`; empty when unresolved. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("baseModel")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModel { get; set; } + + /// + /// Certified deployment profiles available for the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentProfiles")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList DeploymentProfiles { get; set; } + + /// + /// Timestamp when the catalog entry was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Timestamp when the catalog entry was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique ID of the deployable Together-hosted base model. + /// + /// + /// Catalog-controlled HF model ID used for inference. + /// + /// + /// Catalog-controlled human-readable model name. + /// + /// + /// Input modalities supported by the model. + /// + /// + /// Output modalities produced by the model. + /// + /// + /// Product surfaces where the model is offered. + /// + /// + /// High-level tasks the model supports. + /// + /// + /// Organization or publisher associated with the model. + /// + /// + /// Catalog recommendation status for the model. + /// + /// + /// UI-facing model type badge, such as chat, language, code, image, embedding, rerank, moderation, audio, video, or transcribe. + /// + /// + /// Bare model ID for the architecture's base model; empty when no base model is linked. + /// + /// + /// Resource name for the base model as `projects/{projectId}/models/{modelId}`; empty when unresolved. + /// + /// + /// Certified deployment profiles available for the model. + /// + /// + /// Timestamp when the catalog entry was created. + /// + /// + /// Timestamp when the catalog entry was last updated. + /// + /// + /// Human-readable model description. + /// + /// + /// Advanced features exposed by the model. + /// + /// + /// Model architecture from the underlying weights metadata. + /// + /// + /// Maximum context length from the underlying weights metadata. + /// + /// + /// Searchable catalog tags for the model. + /// + /// + /// Preferred input format for the model. + /// + /// + /// Preferred output format for the model. + /// + /// + /// Serverless endpoint name for inference, if available. + /// + /// + /// Model family identifier for related catalog entries. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeSupportedModel( + string id, + string name, + string displayName, + global::System.Collections.Generic.IList inputModalities, + global::System.Collections.Generic.IList outputModalities, + global::System.Collections.Generic.IList products, + global::System.Collections.Generic.IList capabilities, + string publisher, + global::Together.DeSupportedModelStatus status, + string displayType, + string baseModelId, + string baseModel, + global::System.Collections.Generic.IList deploymentProfiles, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? description, + global::System.Collections.Generic.IList? features, + string? architecture, + string? contextLength, + global::System.Collections.Generic.IList? tags, + string? inputFormat, + string? outputFormat, + string? serverlessEndpoint, + string? familyId) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.Description = description; + this.InputModalities = inputModalities ?? throw new global::System.ArgumentNullException(nameof(inputModalities)); + this.OutputModalities = outputModalities ?? throw new global::System.ArgumentNullException(nameof(outputModalities)); + this.Products = products ?? throw new global::System.ArgumentNullException(nameof(products)); + this.Features = features; + this.Capabilities = capabilities ?? throw new global::System.ArgumentNullException(nameof(capabilities)); + this.Architecture = architecture; + this.ContextLength = contextLength; + this.Publisher = publisher ?? throw new global::System.ArgumentNullException(nameof(publisher)); + this.Status = status; + this.Tags = tags; + this.InputFormat = inputFormat; + this.OutputFormat = outputFormat; + this.ServerlessEndpoint = serverlessEndpoint; + this.FamilyId = familyId; + this.DisplayType = displayType ?? throw new global::System.ArgumentNullException(nameof(displayType)); + this.BaseModelId = baseModelId ?? throw new global::System.ArgumentNullException(nameof(baseModelId)); + this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); + this.DeploymentProfiles = deploymentProfiles ?? throw new global::System.ArgumentNullException(nameof(deploymentProfiles)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public DeSupportedModel() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelCapabilitie.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelCapabilitie.g.cs new file mode 100644 index 00000000..4fe20479 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelCapabilitie.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DeSupportedModelCapabilitie + { + /// + /// + /// + CapabilityChat, + /// + /// + /// + CapabilityEmbedding, + /// + /// + /// + CapabilityImageGeneration, + /// + /// + /// + CapabilityReranking, + /// + /// + /// + CapabilityVideoGeneration, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelCapabilitieExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelCapabilitie value) + { + return value switch + { + DeSupportedModelCapabilitie.CapabilityChat => "CAPABILITY_CHAT", + DeSupportedModelCapabilitie.CapabilityEmbedding => "CAPABILITY_EMBEDDING", + DeSupportedModelCapabilitie.CapabilityImageGeneration => "CAPABILITY_IMAGE_GENERATION", + DeSupportedModelCapabilitie.CapabilityReranking => "CAPABILITY_RERANKING", + DeSupportedModelCapabilitie.CapabilityVideoGeneration => "CAPABILITY_VIDEO_GENERATION", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelCapabilitie? ToEnum(string value) + { + return value switch + { + "CAPABILITY_CHAT" => DeSupportedModelCapabilitie.CapabilityChat, + "CAPABILITY_EMBEDDING" => DeSupportedModelCapabilitie.CapabilityEmbedding, + "CAPABILITY_IMAGE_GENERATION" => DeSupportedModelCapabilitie.CapabilityImageGeneration, + "CAPABILITY_RERANKING" => DeSupportedModelCapabilitie.CapabilityReranking, + "CAPABILITY_VIDEO_GENERATION" => DeSupportedModelCapabilitie.CapabilityVideoGeneration, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.Json.g.cs new file mode 100644 index 00000000..71d29ef7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeSupportedModelDeploymentProfile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeSupportedModelDeploymentProfile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeSupportedModelDeploymentProfile), + jsonSerializerContext) as global::Together.DeSupportedModelDeploymentProfile; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeSupportedModelDeploymentProfile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeSupportedModelDeploymentProfile? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeSupportedModelDeploymentProfile), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeSupportedModelDeploymentProfile; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs new file mode 100644 index 00000000..5c44f74b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs @@ -0,0 +1,164 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// Certified deployment profile for a supported model. + /// + public sealed partial class DeSupportedModelDeploymentProfile + { + /// + /// Stable profile identifier, usually the certified config id. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("profileId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProfileId { get; set; } + + /// + /// Certified configuration revision identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certifiedConfigRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CertifiedConfigRevisionId { get; set; } + + /// + /// Certified model weight revision identifier, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("certifiedModelRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CertifiedModelRevisionId { get; set; } + + /// + /// GPU instance type for the profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuType")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string GpuType { get; set; } + + /// + /// Number of GPUs required by the profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpuCount")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int GpuCount { get; set; } + + /// + /// Quantization method for the profile, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Quantization { get; set; } + + /// + /// Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tensorParallelSize")] + [global::System.Obsolete("This property marked as deprecated.")] + public int? TensorParallelSize { get; set; } + + /// + /// Performance benchmarks for the profile, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("performanceBenchmarks")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeSupportedModelPerformanceBenchmarks PerformanceBenchmarks { get; set; } + + /// + /// Certified config revision in the form `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does not pin a config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Config { get; set; } + + /// + /// Deployable model resource in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when the profile does not pin model weights. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD; supersedes tensor_parallel_size. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parallelism")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Parallelism { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Stable profile identifier, usually the certified config id. + /// + /// + /// Certified configuration revision identifier. + /// + /// + /// Certified model weight revision identifier, if available. + /// + /// + /// GPU instance type for the profile. + /// + /// + /// Number of GPUs required by the profile. + /// + /// + /// Quantization method for the profile, if available. + /// + /// + /// Performance benchmarks for the profile, if available. + /// + /// + /// Certified config revision in the form `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does not pin a config. + /// + /// + /// Deployable model resource in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when the profile does not pin model weights. + /// + /// + /// Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD; supersedes tensor_parallel_size. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeSupportedModelDeploymentProfile( + string profileId, + string certifiedConfigRevisionId, + string certifiedModelRevisionId, + string gpuType, + int gpuCount, + string quantization, + global::Together.DeSupportedModelPerformanceBenchmarks performanceBenchmarks, + string config, + string model, + string parallelism) + { + this.ProfileId = profileId ?? throw new global::System.ArgumentNullException(nameof(profileId)); + this.CertifiedConfigRevisionId = certifiedConfigRevisionId ?? throw new global::System.ArgumentNullException(nameof(certifiedConfigRevisionId)); + this.CertifiedModelRevisionId = certifiedModelRevisionId ?? throw new global::System.ArgumentNullException(nameof(certifiedModelRevisionId)); + this.GpuType = gpuType ?? throw new global::System.ArgumentNullException(nameof(gpuType)); + this.GpuCount = gpuCount; + this.Quantization = quantization ?? throw new global::System.ArgumentNullException(nameof(quantization)); + this.PerformanceBenchmarks = performanceBenchmarks ?? throw new global::System.ArgumentNullException(nameof(performanceBenchmarks)); + this.Config = config ?? throw new global::System.ArgumentNullException(nameof(config)); + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Parallelism = parallelism ?? throw new global::System.ArgumentNullException(nameof(parallelism)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeSupportedModelDeploymentProfile() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelFeature.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelFeature.g.cs new file mode 100644 index 00000000..9ba21138 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelFeature.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DeSupportedModelFeature + { + /// + /// + /// + FeatureReasoning, + /// + /// + /// + FeatureStructuredOutput, + /// + /// + /// + FeatureToolCalling, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelFeatureExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelFeature value) + { + return value switch + { + DeSupportedModelFeature.FeatureReasoning => "FEATURE_REASONING", + DeSupportedModelFeature.FeatureStructuredOutput => "FEATURE_STRUCTURED_OUTPUT", + DeSupportedModelFeature.FeatureToolCalling => "FEATURE_TOOL_CALLING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelFeature? ToEnum(string value) + { + return value switch + { + "FEATURE_REASONING" => DeSupportedModelFeature.FeatureReasoning, + "FEATURE_STRUCTURED_OUTPUT" => DeSupportedModelFeature.FeatureStructuredOutput, + "FEATURE_TOOL_CALLING" => DeSupportedModelFeature.FeatureToolCalling, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelInputModalitie.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelInputModalitie.g.cs new file mode 100644 index 00000000..c0f4f99e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelInputModalitie.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DeSupportedModelInputModalitie + { + /// + /// + /// + ModalityAudio, + /// + /// + /// + ModalityImage, + /// + /// + /// + ModalityText, + /// + /// + /// + ModalityVideo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelInputModalitieExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelInputModalitie value) + { + return value switch + { + DeSupportedModelInputModalitie.ModalityAudio => "MODALITY_AUDIO", + DeSupportedModelInputModalitie.ModalityImage => "MODALITY_IMAGE", + DeSupportedModelInputModalitie.ModalityText => "MODALITY_TEXT", + DeSupportedModelInputModalitie.ModalityVideo => "MODALITY_VIDEO", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelInputModalitie? ToEnum(string value) + { + return value switch + { + "MODALITY_AUDIO" => DeSupportedModelInputModalitie.ModalityAudio, + "MODALITY_IMAGE" => DeSupportedModelInputModalitie.ModalityImage, + "MODALITY_TEXT" => DeSupportedModelInputModalitie.ModalityText, + "MODALITY_VIDEO" => DeSupportedModelInputModalitie.ModalityVideo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelOutputModalitie.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelOutputModalitie.g.cs new file mode 100644 index 00000000..9128d745 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelOutputModalitie.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DeSupportedModelOutputModalitie + { + /// + /// + /// + ModalityAudio, + /// + /// + /// + ModalityImage, + /// + /// + /// + ModalityText, + /// + /// + /// + ModalityVideo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelOutputModalitieExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelOutputModalitie value) + { + return value switch + { + DeSupportedModelOutputModalitie.ModalityAudio => "MODALITY_AUDIO", + DeSupportedModelOutputModalitie.ModalityImage => "MODALITY_IMAGE", + DeSupportedModelOutputModalitie.ModalityText => "MODALITY_TEXT", + DeSupportedModelOutputModalitie.ModalityVideo => "MODALITY_VIDEO", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelOutputModalitie? ToEnum(string value) + { + return value switch + { + "MODALITY_AUDIO" => DeSupportedModelOutputModalitie.ModalityAudio, + "MODALITY_IMAGE" => DeSupportedModelOutputModalitie.ModalityImage, + "MODALITY_TEXT" => DeSupportedModelOutputModalitie.ModalityText, + "MODALITY_VIDEO" => DeSupportedModelOutputModalitie.ModalityVideo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.Json.g.cs new file mode 100644 index 00000000..2410a412 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeSupportedModelPerformanceBenchmarks + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeSupportedModelPerformanceBenchmarks? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeSupportedModelPerformanceBenchmarks), + jsonSerializerContext) as global::Together.DeSupportedModelPerformanceBenchmarks; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeSupportedModelPerformanceBenchmarks? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeSupportedModelPerformanceBenchmarks? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeSupportedModelPerformanceBenchmarks), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeSupportedModelPerformanceBenchmarks; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.g.cs new file mode 100644 index 00000000..18318964 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelPerformanceBenchmarks.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Performance benchmark metrics for a supported model profile. + /// + public sealed partial class DeSupportedModelPerformanceBenchmarks + { + /// + /// Decoding throughput in tokens per second. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("decodingSpeedTps")] + public double? DecodingSpeedTps { get; set; } + + /// + /// Time to first token in milliseconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeToFirstTokenMs")] + public int? TimeToFirstTokenMs { get; set; } + + /// + /// Maximum context length supported by the profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxContextLength")] + public string? MaxContextLength { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Decoding throughput in tokens per second. + /// + /// + /// Time to first token in milliseconds. + /// + /// + /// Maximum context length supported by the profile. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeSupportedModelPerformanceBenchmarks( + double? decodingSpeedTps, + int? timeToFirstTokenMs, + string? maxContextLength) + { + this.DecodingSpeedTps = decodingSpeedTps; + this.TimeToFirstTokenMs = timeToFirstTokenMs; + this.MaxContextLength = maxContextLength; + } + + /// + /// Initializes a new instance of the class. + /// + public DeSupportedModelPerformanceBenchmarks() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelProduct.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelProduct.g.cs new file mode 100644 index 00000000..359e1fbc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelProduct.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DeSupportedModelProduct + { + /// + /// + /// + ProductDedicated, + /// + /// + /// + ProductFineTuning, + /// + /// + /// + ProductServerless, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelProductExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelProduct value) + { + return value switch + { + DeSupportedModelProduct.ProductDedicated => "PRODUCT_DEDICATED", + DeSupportedModelProduct.ProductFineTuning => "PRODUCT_FINE_TUNING", + DeSupportedModelProduct.ProductServerless => "PRODUCT_SERVERLESS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelProduct? ToEnum(string value) + { + return value switch + { + "PRODUCT_DEDICATED" => DeSupportedModelProduct.ProductDedicated, + "PRODUCT_FINE_TUNING" => DeSupportedModelProduct.ProductFineTuning, + "PRODUCT_SERVERLESS" => DeSupportedModelProduct.ProductServerless, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelStatus.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelStatus.g.cs new file mode 100644 index 00000000..c2d48b69 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelStatus.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Catalog recommendation status for the model. + /// + public enum DeSupportedModelStatus + { + /// + /// + /// + SupportedModelStatusDeprecated, + /// + /// + /// + SupportedModelStatusHidden, + /// + /// + /// + SupportedModelStatusRecommended, + /// + /// + /// + SupportedModelStatusSupported, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeSupportedModelStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeSupportedModelStatus value) + { + return value switch + { + DeSupportedModelStatus.SupportedModelStatusDeprecated => "SUPPORTED_MODEL_STATUS_DEPRECATED", + DeSupportedModelStatus.SupportedModelStatusHidden => "SUPPORTED_MODEL_STATUS_HIDDEN", + DeSupportedModelStatus.SupportedModelStatusRecommended => "SUPPORTED_MODEL_STATUS_RECOMMENDED", + DeSupportedModelStatus.SupportedModelStatusSupported => "SUPPORTED_MODEL_STATUS_SUPPORTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeSupportedModelStatus? ToEnum(string value) + { + return value switch + { + "SUPPORTED_MODEL_STATUS_DEPRECATED" => DeSupportedModelStatus.SupportedModelStatusDeprecated, + "SUPPORTED_MODEL_STATUS_HIDDEN" => DeSupportedModelStatus.SupportedModelStatusHidden, + "SUPPORTED_MODEL_STATUS_RECOMMENDED" => DeSupportedModelStatus.SupportedModelStatusRecommended, + "SUPPORTED_MODEL_STATUS_SUPPORTED" => DeSupportedModelStatus.SupportedModelStatusSupported, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeThresholdCheck.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeThresholdCheck.Json.g.cs new file mode 100644 index 00000000..5858af46 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeThresholdCheck.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeThresholdCheck + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeThresholdCheck? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeThresholdCheck), + jsonSerializerContext) as global::Together.DeThresholdCheck; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeThresholdCheck? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeThresholdCheck? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeThresholdCheck), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeThresholdCheck; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeThresholdCheck.g.cs b/src/libs/Together/Generated/Together.Models.DeThresholdCheck.g.cs new file mode 100644 index 00000000..fc5681e4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeThresholdCheck.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Together +{ + /// + /// Threshold criteria that fail when the target metric violates the configured bound. + /// + public sealed partial class DeThresholdCheck + { + /// + /// Required numeric threshold value. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Value { get; set; } + + /// + /// Required comparison operator applied to the target metric value. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("operator")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DeThresholdCheckOperator Operator { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Required numeric threshold value. + /// + /// + /// Required comparison operator applied to the target metric value. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeThresholdCheck( + double value, + global::Together.DeThresholdCheckOperator @operator) + { + this.Value = value; + this.Operator = @operator; + } + + /// + /// Initializes a new instance of the class. + /// + public DeThresholdCheck() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeThresholdCheckOperator.g.cs b/src/libs/Together/Generated/Together.Models.DeThresholdCheckOperator.g.cs new file mode 100644 index 00000000..8b7862c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeThresholdCheckOperator.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Required comparison operator applied to the target metric value. + /// + public enum DeThresholdCheckOperator + { + /// + /// + /// + ThresholdOperatorGt, + /// + /// + /// + ThresholdOperatorGte, + /// + /// + /// + ThresholdOperatorLt, + /// + /// + /// + ThresholdOperatorLte, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeThresholdCheckOperatorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeThresholdCheckOperator value) + { + return value switch + { + DeThresholdCheckOperator.ThresholdOperatorGt => "THRESHOLD_OPERATOR_GT", + DeThresholdCheckOperator.ThresholdOperatorGte => "THRESHOLD_OPERATOR_GTE", + DeThresholdCheckOperator.ThresholdOperatorLt => "THRESHOLD_OPERATOR_LT", + DeThresholdCheckOperator.ThresholdOperatorLte => "THRESHOLD_OPERATOR_LTE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeThresholdCheckOperator? ToEnum(string value) + { + return value switch + { + "THRESHOLD_OPERATOR_GT" => DeThresholdCheckOperator.ThresholdOperatorGt, + "THRESHOLD_OPERATOR_GTE" => DeThresholdCheckOperator.ThresholdOperatorGte, + "THRESHOLD_OPERATOR_LT" => DeThresholdCheckOperator.ThresholdOperatorLt, + "THRESHOLD_OPERATOR_LTE" => DeThresholdCheckOperator.ThresholdOperatorLte, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.Json.g.cs new file mode 100644 index 00000000..ccc3863a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeThroughputMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeThroughputMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeThroughputMetrics), + jsonSerializerContext) as global::Together.DeThroughputMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeThroughputMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeThroughputMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeThroughputMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeThroughputMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.g.cs new file mode 100644 index 00000000..91d1a302 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeThroughputMetrics.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace Together +{ + /// + /// Token, request, and batching throughput over a time range. + /// + public sealed partial class DeThroughputMetrics + { + /// + /// Average generated tokens per second. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokensPerSecond")] + public double? TokensPerSecond { get; set; } + + /// + /// Average completed requests per second. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requestsPerSecond")] + public double? RequestsPerSecond { get; set; } + + /// + /// Average number of requests processed in each runtime batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("avgBatchSize")] + public double? AvgBatchSize { get; set; } + + /// + /// Average number of batches queued or in flight in the serving engine. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("avgBatchDepth")] + public double? AvgBatchDepth { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Average generated tokens per second. + /// + /// + /// Average completed requests per second. + /// + /// + /// Average number of requests processed in each runtime batch. + /// + /// + /// Average number of batches queued or in flight in the serving engine. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeThroughputMetrics( + double? tokensPerSecond, + double? requestsPerSecond, + double? avgBatchSize, + double? avgBatchDepth) + { + this.TokensPerSecond = tokensPerSecond; + this.RequestsPerSecond = requestsPerSecond; + this.AvgBatchSize = avgBatchSize; + this.AvgBatchDepth = avgBatchDepth; + } + + /// + /// Initializes a new instance of the class. + /// + public DeThroughputMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.Json.g.cs new file mode 100644 index 00000000..76b9d86a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeTimeSeriesDataPoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeTimeSeriesDataPoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeTimeSeriesDataPoint), + jsonSerializerContext) as global::Together.DeTimeSeriesDataPoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeTimeSeriesDataPoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeTimeSeriesDataPoint? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeTimeSeriesDataPoint), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeTimeSeriesDataPoint; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.g.cs b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.g.cs new file mode 100644 index 00000000..7714a76d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPoint.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Timestamped bucket containing one or more named metric values. + /// + public sealed partial class DeTimeSeriesDataPoint + { + /// + /// Start time of the metric bucket. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + public global::System.DateTime? Timestamp { get; set; } + + /// + /// Metric names mapped to their numeric values for this bucket. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("values")] + public global::System.Collections.Generic.Dictionary? Values { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Start time of the metric bucket. + /// + /// + /// Metric names mapped to their numeric values for this bucket. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeTimeSeriesDataPoint( + global::System.DateTime? timestamp, + global::System.Collections.Generic.Dictionary? values) + { + this.Timestamp = timestamp; + this.Values = values; + } + + /// + /// Initializes a new instance of the class. + /// + public DeTimeSeriesDataPoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.Json.g.cs new file mode 100644 index 00000000..aa098316 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeTimeSeriesDataPointValues + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeTimeSeriesDataPointValues? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeTimeSeriesDataPointValues), + jsonSerializerContext) as global::Together.DeTimeSeriesDataPointValues; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeTimeSeriesDataPointValues? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeTimeSeriesDataPointValues? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeTimeSeriesDataPointValues), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeTimeSeriesDataPointValues; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.g.cs b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.g.cs new file mode 100644 index 00000000..e9f113cb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTimeSeriesDataPointValues.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Metric names mapped to their numeric values for this bucket. + /// + public sealed partial class DeTimeSeriesDataPointValues + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeTokenMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeTokenMetrics.Json.g.cs new file mode 100644 index 00000000..7fa1ee90 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTokenMetrics.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeTokenMetrics + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeTokenMetrics? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeTokenMetrics), + jsonSerializerContext) as global::Together.DeTokenMetrics; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeTokenMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeTokenMetrics? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeTokenMetrics), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeTokenMetrics; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeTokenMetrics.g.cs b/src/libs/Together/Generated/Together.Models.DeTokenMetrics.g.cs new file mode 100644 index 00000000..04eb7126 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTokenMetrics.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace Together +{ + /// + /// Aggregate and per-request token usage over a time range. + /// + public sealed partial class DeTokenMetrics + { + /// + /// Total input tokens processed during the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalInputTokens")] + public string? TotalInputTokens { get; set; } + + /// + /// Total output tokens generated during the time range. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("totalOutputTokens")] + public string? TotalOutputTokens { get; set; } + + /// + /// Average input tokens per request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("avgInputTokens")] + public double? AvgInputTokens { get; set; } + + /// + /// Average output tokens per request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("avgOutputTokens")] + public double? AvgOutputTokens { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Total input tokens processed during the time range. + /// + /// + /// Total output tokens generated during the time range. + /// + /// + /// Average input tokens per request. + /// + /// + /// Average output tokens per request. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeTokenMetrics( + string? totalInputTokens, + string? totalOutputTokens, + double? avgInputTokens, + double? avgOutputTokens) + { + this.TotalInputTokens = totalInputTokens; + this.TotalOutputTokens = totalOutputTokens; + this.AvgInputTokens = avgInputTokens; + this.AvgOutputTokens = avgOutputTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public DeTokenMetrics() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.Json.g.cs new file mode 100644 index 00000000..afbb1c66 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeTrafficSplitEntry + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeTrafficSplitEntry? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeTrafficSplitEntry), + jsonSerializerContext) as global::Together.DeTrafficSplitEntry; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeTrafficSplitEntry? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeTrafficSplitEntry? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeTrafficSplitEntry), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeTrafficSplitEntry; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.g.cs b/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.g.cs new file mode 100644 index 00000000..afb87314 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeTrafficSplitEntry.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace Together +{ + /// + /// Capacity weight assigned to one deployment in an endpoint's live traffic split. + /// + public sealed partial class DeTrafficSplitEntry + { + /// + /// ID of a deployment under the endpoint that can receive live traffic. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deploymentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DeploymentId { get; set; } + + /// + /// Non-negative, finite weight applied to each ready replica. A deployment's
+ /// effective routing capacity is `weight * readyReplicas`, and requests are
+ /// distributed in proportion to that capacity. Set to `0` to remove the
+ /// deployment from the live traffic split. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("weight")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Weight { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of a deployment under the endpoint that can receive live traffic. + /// + /// + /// Non-negative, finite weight applied to each ready replica. A deployment's
+ /// effective routing capacity is `weight * readyReplicas`, and requests are
+ /// distributed in proportion to that capacity. Set to `0` to remove the
+ /// deployment from the live traffic split. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeTrafficSplitEntry( + string deploymentId, + double weight) + { + this.DeploymentId = deploymentId ?? throw new global::System.ArgumentNullException(nameof(deploymentId)); + this.Weight = weight; + } + + /// + /// Initializes a new instance of the class. + /// + public DeTrafficSplitEntry() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.Json.g.cs new file mode 100644 index 00000000..285a072c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateABExperimentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateABExperimentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateABExperimentRequest), + jsonSerializerContext) as global::Together.DeUpdateABExperimentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateABExperimentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateABExperimentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateABExperimentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateABExperimentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.g.cs new file mode 100644 index 00000000..091e91d1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateABExperimentRequest.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable description and traffic allocation for an A/B experiment. + /// + public sealed partial class DeUpdateABExperimentRequest + { + /// + /// Updated free-form description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("members")] + public global::System.Collections.Generic.IList? Members { get; set; } + + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated free-form description. + /// + /// + /// Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateABExperimentRequest( + string? description, + global::System.Collections.Generic.IList? members, + string? etag) + { + this.Description = description; + this.Members = members; + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateABExperimentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.Json.g.cs new file mode 100644 index 00000000..e1a74fa2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateAdapterRequest), + jsonSerializerContext) as global::Together.DeUpdateAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateAdapterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateAdapterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.g.cs new file mode 100644 index 00000000..fb7f2688 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateAdapterRequest.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request body for updating an adapter. + /// + public sealed partial class DeUpdateAdapterRequest + { + /// + /// New adapter revision to pin. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapterRevisionId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AdapterRevisionId { get; set; } + + /// + /// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// New adapter revision to pin. + /// + /// + /// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateAdapterRequest( + string adapterRevisionId, + string etag) + { + this.AdapterRevisionId = adapterRevisionId ?? throw new global::System.ArgumentNullException(nameof(adapterRevisionId)); + this.Etag = etag ?? throw new global::System.ArgumentNullException(nameof(etag)); + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateAdapterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.Json.g.cs new file mode 100644 index 00000000..0d895e00 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateDeploymentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateDeploymentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateDeploymentRequest), + jsonSerializerContext) as global::Together.DeUpdateDeploymentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateDeploymentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateDeploymentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateDeploymentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateDeploymentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.g.cs new file mode 100644 index 00000000..a93a0dc3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateDeploymentRequest.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable deployment settings. Use the resource-name fields or their deprecated ID alternatives for a model or config change, but not both. + /// + public sealed partial class DeUpdateDeploymentRequest + { + /// + /// Updated endpoint string. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Updated autoscaling configuration. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + public global::Together.DeAutoscaling? Autoscaling { get; set; } + + /// + /// Current deployment version. The update is rejected if this value no longer matches. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated endpoint string. + /// + /// + /// Updated autoscaling configuration. + /// + /// + /// Current deployment version. The update is rejected if this value no longer matches. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateDeploymentRequest( + string? name, + global::Together.DeAutoscaling? autoscaling, + string? etag) + { + this.Name = name; + this.Autoscaling = autoscaling; + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateDeploymentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.Json.g.cs new file mode 100644 index 00000000..7d445864 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateModelRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateModelRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateModelRequest), + jsonSerializerContext) as global::Together.DeUpdateModelRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateModelRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateModelRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateModelRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.g.cs new file mode 100644 index 00000000..67e8e162 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequest.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable metadata for a custom model resource. + /// + public sealed partial class DeUpdateModelRequest + { + /// + /// Updated inference-addressable model name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Updated user-facing model description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter))] + public global::Together.DeUpdateModelRequestVisibility? Visibility { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated inference-addressable model name. + /// + /// + /// Updated user-facing model description. + /// + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateModelRequest( + string? name, + string? description, + global::Together.DeUpdateModelRequestVisibility? visibility) + { + this.Name = name; + this.Description = description; + this.Visibility = visibility; + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateModelRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateModelRequestVisibility.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequestVisibility.g.cs new file mode 100644 index 00000000..3d957a1f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateModelRequestVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + ///
+ public enum DeUpdateModelRequestVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeUpdateModelRequestVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeUpdateModelRequestVisibility value) + { + return value switch + { + DeUpdateModelRequestVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + DeUpdateModelRequestVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeUpdateModelRequestVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => DeUpdateModelRequestVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => DeUpdateModelRequestVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.Json.g.cs new file mode 100644 index 00000000..d473f230 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateShadowExperimentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateShadowExperimentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateShadowExperimentRequest), + jsonSerializerContext) as global::Together.DeUpdateShadowExperimentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateShadowExperimentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateShadowExperimentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateShadowExperimentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateShadowExperimentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.g.cs new file mode 100644 index 00000000..3cb27388 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentRequest.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable description and source sampling strategy for a shadow experiment. + /// + public sealed partial class DeUpdateShadowExperimentRequest + { + /// + /// Updated free-form description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Updated endpoint sampling configuration. Source updates require etag in the request body. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source")] + public global::Together.DeShadowExperimentSource? Source { get; set; } + + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated free-form description. + /// + /// + /// Updated endpoint sampling configuration. Source updates require etag in the request body. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateShadowExperimentRequest( + string? description, + global::Together.DeShadowExperimentSource? source, + string? etag) + { + this.Description = description; + this.Source = source; + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateShadowExperimentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.Json.g.cs new file mode 100644 index 00000000..7e3b93b0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DeUpdateShadowExperimentTargetRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DeUpdateShadowExperimentTargetRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DeUpdateShadowExperimentTargetRequest), + jsonSerializerContext) as global::Together.DeUpdateShadowExperimentTargetRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeUpdateShadowExperimentTargetRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DeUpdateShadowExperimentTargetRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DeUpdateShadowExperimentTargetRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeUpdateShadowExperimentTargetRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.g.cs b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.g.cs new file mode 100644 index 00000000..d853d584 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DeUpdateShadowExperimentTargetRequest.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace Together +{ + /// + /// Mutable name, deployment, and description for a shadow experiment target. + /// + public sealed partial class DeUpdateShadowExperimentTargetRequest + { + /// + /// Updated human-readable target name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Replacement deployment under the parent endpoint. Exclude it from the endpoint's live traffic split. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("targetDeploymentId")] + public string? TargetDeploymentId { get; set; } + + /// + /// Updated free-form target description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Updated human-readable target name. + /// + /// + /// Replacement deployment under the parent endpoint. Exclude it from the endpoint's live traffic split. + /// + /// + /// Updated free-form target description. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeUpdateShadowExperimentTargetRequest( + string? name, + string? targetDeploymentId, + string? description, + string? etag) + { + this.Name = name; + this.TargetDeploymentId = targetDeploymentId; + this.Description = description; + this.Etag = etag; + } + + /// + /// Initializes a new instance of the class. + /// + public DeUpdateShadowExperimentTargetRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs index 6c3dedbe..ae2e2cca 100644 --- a/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DedicatedEndpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DedicatedEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DedicatedEndpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs index 7935dcf0..39ad9e0b 100644 --- a/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DedicatedEndpointObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DedicatedEndpointObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DedicatedEndpointObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse.Json.g.cs index 65ec6289..a3ee4f2b 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse2.Json.g.cs index ded1d413..5c8a684c 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse3.Json.g.cs index e700c27c..57c857e5 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse.Json.g.cs index 9f5d3930..ed358c7d 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsSecretsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse2.Json.g.cs index f14db4c2..1da68a5b 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsSecretsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse3.Json.g.cs index 5df72d50..b5ef1619 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsSecretsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsSecretsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse.Json.g.cs index 8a287e19..823e3363 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsStorageVolumesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse2.Json.g.cs index 7a22fc3d..c7572185 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsStorageVolumesResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse3.Json.g.cs index 9ae431bf..bb471231 100644 --- a/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeleteDeploymentsStorageVolumesResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeleteDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeleteDeploymentsStorageVolumesResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeleteDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentListResponse.Json.g.cs index 342c6509..3be0e8d8 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentListResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentListResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentListResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentListResponseObject.Json.g.cs index 407958f2..d2f79904 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentListResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentListResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentListResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentListResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentListResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentLogs.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentLogs.Json.g.cs index f19fb234..6386f17d 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentLogs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentLogs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentLogs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentLogs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentLogs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentResponseItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentResponseItem.Json.g.cs index fcda49fa..c9b70827 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentResponseItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentResponseItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentResponseItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentResponseItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentResponseItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentResponseItemObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentResponseItemObject.Json.g.cs index d0ff93d6..12dbd531 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentResponseItemObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentResponseItemObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentResponseItemObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentResponseItemObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentResponseItemObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DeploymentResponseItemReplicaEvents.Json.g.cs b/src/libs/Together/Generated/Together.Models.DeploymentResponseItemReplicaEvents.Json.g.cs index 5da2be7c..c9328570 100644 --- a/src/libs/Together/Generated/Together.Models.DeploymentResponseItemReplicaEvents.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeploymentResponseItemReplicaEvents.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DeploymentResponseItemReplicaEvents; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DeploymentResponseItemReplicaEvents? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DeploymentResponseItemReplicaEvents; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs index 1a7cf88d..eec4213e 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs index 865e765d..ce59be4c 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutputData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs index 336c8e32..b9ead604 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs index 990dc2b1..7d05a1b2 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs index ef4e6eaa..4b7df21f 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs index c1757269..68d67000 100644 --- a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EmbeddingsRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.EmbeddingsRequest.Json.g.cs index 9da24135..75bc6d13 100644 --- a/src/libs/Together/Generated/Together.Models.EmbeddingsRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EmbeddingsRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EmbeddingsRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EmbeddingsRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EmbeddingsRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EmbeddingsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.EmbeddingsResponse.Json.g.cs index c57697fd..c3dc7f2d 100644 --- a/src/libs/Together/Generated/Together.Models.EmbeddingsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EmbeddingsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EmbeddingsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EmbeddingsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EmbeddingsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItem.Json.g.cs index cd41e90e..b9485cd5 100644 --- a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EmbeddingsResponseDataItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EmbeddingsResponseDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EmbeddingsResponseDataItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItemObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItemObject.Json.g.cs index 45a90d16..307b1f3b 100644 --- a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItemObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseDataItemObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EmbeddingsResponseDataItemObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EmbeddingsResponseDataItemObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EmbeddingsResponseDataItemObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseObject.Json.g.cs index f06b1419..30911d23 100644 --- a/src/libs/Together/Generated/Together.Models.EmbeddingsResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EmbeddingsResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EmbeddingsResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EmbeddingsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EmbeddingsResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs b/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs index ab839543..2635cea6 100644 --- a/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EndpointPricing; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EndpointPricing? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EndpointPricing; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs b/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs index 5104ae84..59c63442 100644 --- a/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs +++ b/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs @@ -13,7 +13,7 @@ public sealed partial class EndpointPricing /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_minute")] [global::System.Text.Json.Serialization.JsonRequired] - public required float CentsPerMinute { get; set; } + public required double CentsPerMinute { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -31,7 +31,7 @@ public sealed partial class EndpointPricing [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EndpointPricing( - float centsPerMinute) + double centsPerMinute) { this.CentsPerMinute = centsPerMinute; } diff --git a/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsMinLevel.g.cs b/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsMinLevel.g.cs new file mode 100644 index 00000000..87b3c845 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsMinLevel.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Minimum severity. Omit to disable severity filtering. + /// + public enum EndpointServiceListEndpointEventsMinLevel + { + /// + /// + /// + LevelDebug, + /// + /// + /// + LevelError, + /// + /// + /// + LevelInfo, + /// + /// + /// + LevelWarn, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class EndpointServiceListEndpointEventsMinLevelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this EndpointServiceListEndpointEventsMinLevel value) + { + return value switch + { + EndpointServiceListEndpointEventsMinLevel.LevelDebug => "LEVEL_DEBUG", + EndpointServiceListEndpointEventsMinLevel.LevelError => "LEVEL_ERROR", + EndpointServiceListEndpointEventsMinLevel.LevelInfo => "LEVEL_INFO", + EndpointServiceListEndpointEventsMinLevel.LevelWarn => "LEVEL_WARN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static EndpointServiceListEndpointEventsMinLevel? ToEnum(string value) + { + return value switch + { + "LEVEL_DEBUG" => EndpointServiceListEndpointEventsMinLevel.LevelDebug, + "LEVEL_ERROR" => EndpointServiceListEndpointEventsMinLevel.LevelError, + "LEVEL_INFO" => EndpointServiceListEndpointEventsMinLevel.LevelInfo, + "LEVEL_WARN" => EndpointServiceListEndpointEventsMinLevel.LevelWarn, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsSourceKind.g.cs b/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsSourceKind.g.cs new file mode 100644 index 00000000..799ab59f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.EndpointServiceListEndpointEventsSourceKind.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum EndpointServiceListEndpointEventsSourceKind + { + /// + /// + /// + SourceKindDeployment, + /// + /// + /// + SourceKindEndpoint, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class EndpointServiceListEndpointEventsSourceKindExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this EndpointServiceListEndpointEventsSourceKind value) + { + return value switch + { + EndpointServiceListEndpointEventsSourceKind.SourceKindDeployment => "SOURCE_KIND_DEPLOYMENT", + EndpointServiceListEndpointEventsSourceKind.SourceKindEndpoint => "SOURCE_KIND_ENDPOINT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static EndpointServiceListEndpointEventsSourceKind? ToEnum(string value) + { + return value switch + { + "SOURCE_KIND_DEPLOYMENT" => EndpointServiceListEndpointEventsSourceKind.SourceKindDeployment, + "SOURCE_KIND_ENDPOINT" => EndpointServiceListEndpointEventsSourceKind.SourceKindEndpoint, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.EnvironmentVariable.Json.g.cs b/src/libs/Together/Generated/Together.Models.EnvironmentVariable.Json.g.cs index 600a12aa..a8d942ad 100644 --- a/src/libs/Together/Generated/Together.Models.EnvironmentVariable.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EnvironmentVariable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EnvironmentVariable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EnvironmentVariable? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EnvironmentVariable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.Error.Json.g.cs b/src/libs/Together/Generated/Together.Models.Error.Json.g.cs index 20736bad..0ca1a208 100644 --- a/src/libs/Together/Generated/Together.Models.Error.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Error.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.Error?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Error? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.Error?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ErrorData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorData.Json.g.cs index 92b4872b..46626217 100644 --- a/src/libs/Together/Generated/Together.Models.ErrorData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ErrorData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ErrorData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ErrorDataError.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorDataError.Json.g.cs index ebcffbd8..82182047 100644 --- a/src/libs/Together/Generated/Together.Models.ErrorDataError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorDataError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ErrorDataError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ErrorDataError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorDataError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs index 58629938..1d38f534 100644 --- a/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ErrorOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ErrorOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ErrorResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorResponse.Json.g.cs index 57649818..ff9763ad 100644 --- a/src/libs/Together/Generated/Together.Models.ErrorResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ErrorResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs index 709b65de..aedacaca 100644 --- a/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ErrorVariant2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ErrorVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorVariant2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationClassifyParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationClassifyParameters.Json.g.cs index 3ab48d9f..26b6c702 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationClassifyParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationClassifyParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationClassifyParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationClassifyParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationClassifyParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.Json.g.cs index eb66c880..2592dfc0 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationClassifyResults; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationClassifyResults? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationClassifyResults; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.g.cs index 9b200a89..044cc9f2 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationClassifyResults.g.cs @@ -30,7 +30,7 @@ public sealed partial class EvaluationClassifyResults /// /// 0 [global::System.Text.Json.Serialization.JsonPropertyName("invalid_label_count")] - public float? InvalidLabelCount { get; set; } + public double? InvalidLabelCount { get; set; } /// /// Data File ID
@@ -95,7 +95,7 @@ public sealed partial class EvaluationClassifyResults public EvaluationClassifyResults( double? generationFailCount, double? judgeFailCount, - float? invalidLabelCount, + double? invalidLabelCount, string? resultFileId, double? passPercentage, string? labelCounts) diff --git a/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.Json.g.cs index 4b031838..ef99b1cd 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationCompareParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationCompareParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationCompareParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.g.cs index f36b0893..77cbdba6 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationCompareParameters.g.cs @@ -16,26 +16,35 @@ public sealed partial class EvaluationCompareParameters public required global::Together.EvaluationJudgeModelConfig Judge { get; set; } /// - /// + /// Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. /// [global::System.Text.Json.Serialization.JsonPropertyName("model_a")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.EvaluationModelOrStringJsonConverter))] - public global::Together.EvaluationModelOrString? ModelA { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] + public global::Together.OneOf? ModelA { get; set; } /// - /// + /// Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. /// [global::System.Text.Json.Serialization.JsonPropertyName("model_b")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.EvaluationModelOrStringJsonConverter))] - public global::Together.EvaluationModelOrString? ModelB { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] + public global::Together.OneOf? ModelB { get; set; } /// - /// Data file name + /// Data file ID
+ /// Example: file-01234567890123456789 ///
+ /// file-01234567890123456789 [global::System.Text.Json.Serialization.JsonPropertyName("input_data_file_path")] [global::System.Text.Json.Serialization.JsonRequired] public required string InputDataFilePath { get; set; } + /// + /// When false (default), the judge runs twice per sample: once with model A's response first (original order) and once with model B's response first (flipped order). The two verdicts are reconciled to cancel out position bias. When true, only the original-order pass is run, halving judge cost and latency at the expense of position-bias correction. The result file will not contain flipped-order judge fields when this is true.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("disable_position_bias_correction")] + public bool? DisablePositionBiasCorrection { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -47,23 +56,34 @@ public sealed partial class EvaluationCompareParameters ///
/// /// - /// Data file name + /// Data file ID
+ /// Example: file-01234567890123456789 + /// + /// + /// Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. + /// + /// + /// Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. + /// + /// + /// When false (default), the judge runs twice per sample: once with model A's response first (original order) and once with model B's response first (flipped order). The two verdicts are reconciled to cancel out position bias. When true, only the original-order pass is run, halving judge cost and latency at the expense of position-bias correction. The result file will not contain flipped-order judge fields when this is true.
+ /// Default Value: false /// - /// - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EvaluationCompareParameters( global::Together.EvaluationJudgeModelConfig judge, string inputDataFilePath, - global::Together.EvaluationModelOrString? modelA, - global::Together.EvaluationModelOrString? modelB) + global::Together.OneOf? modelA, + global::Together.OneOf? modelB, + bool? disablePositionBiasCorrection) { this.Judge = judge ?? throw new global::System.ArgumentNullException(nameof(judge)); this.ModelA = modelA; this.ModelB = modelB; this.InputDataFilePath = inputDataFilePath ?? throw new global::System.ArgumentNullException(nameof(inputDataFilePath)); + this.DisablePositionBiasCorrection = disablePositionBiasCorrection; } /// diff --git a/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.Json.g.cs index 4b65e67c..8e545187 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationCompareResults; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationCompareResults? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationCompareResults; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.g.cs index 90cbfc31..1e5f0fa2 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationCompareResults.g.cs @@ -9,31 +9,25 @@ namespace Together public sealed partial class EvaluationCompareResults { /// - /// Total number of samples compared - /// - [global::System.Text.Json.Serialization.JsonPropertyName("num_samples")] - public int? NumSamples { get; set; } - - /// - /// Number of times model A won + /// Number of samples where model A was judged the winner /// [global::System.Text.Json.Serialization.JsonPropertyName("A_wins")] public int? AWins { get; set; } /// - /// Number of times model B won + /// Number of samples where model B was judged the winner /// [global::System.Text.Json.Serialization.JsonPropertyName("B_wins")] public int? BWins { get; set; } /// - /// Number of ties + /// Number of samples that resulted in a tie score /// [global::System.Text.Json.Serialization.JsonPropertyName("Ties")] public int? Ties { get; set; } /// - /// Number of failed generations.
+ /// Number of generation failures across model A and model B.
/// Example: 0 ///
/// 0 @@ -41,7 +35,7 @@ public sealed partial class EvaluationCompareResults public double? GenerationFailCount { get; set; } /// - /// Number of failed judge generations
+ /// Number of judge inference failures. In the default two-pass mode (disable_position_bias_correction=false) this is the combined failure count from both the original-order and flipped-order judge passes.
/// Example: 0 ///
/// 0 @@ -49,7 +43,7 @@ public sealed partial class EvaluationCompareResults public double? JudgeFailCount { get; set; } /// - /// Data File ID + /// File ID of the detailed output file. Each row contains the original input fields plus judge outputs. In two-pass mode the file includes both original-order and flipped-order judge fields; in single-pass mode (disable_position_bias_correction=true) only original-order fields are present. /// [global::System.Text.Json.Serialization.JsonPropertyName("result_file_id")] public string? ResultFileId { get; set; } @@ -63,34 +57,30 @@ public sealed partial class EvaluationCompareResults /// /// Initializes a new instance of the class. /// - /// - /// Total number of samples compared - /// /// - /// Number of times model A won + /// Number of samples where model A was judged the winner /// /// - /// Number of times model B won + /// Number of samples where model B was judged the winner /// /// - /// Number of ties + /// Number of samples that resulted in a tie score /// /// - /// Number of failed generations.
+ /// Number of generation failures across model A and model B.
/// Example: 0 /// /// - /// Number of failed judge generations
+ /// Number of judge inference failures. In the default two-pass mode (disable_position_bias_correction=false) this is the combined failure count from both the original-order and flipped-order judge passes.
/// Example: 0 /// /// - /// Data File ID + /// File ID of the detailed output file. Each row contains the original input fields plus judge outputs. In two-pass mode the file includes both original-order and flipped-order judge fields; in single-pass mode (disable_position_bias_correction=true) only original-order fields are present. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EvaluationCompareResults( - int? numSamples, int? aWins, int? bWins, int? ties, @@ -98,7 +88,6 @@ public EvaluationCompareResults( double? judgeFailCount, string? resultFileId) { - this.NumSamples = numSamples; this.AWins = aWins; this.BWins = bWins; this.Ties = ties; diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJob.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJob.Json.g.cs index 89307451..aad62501 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJob.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJob.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationJob; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationJob? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationJob; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJobParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJobParameters.Json.g.cs index 71f462a0..4a871227 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJobParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJobParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationJobParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationJobParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationJobParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJobResults.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJobResults.Json.g.cs index 0f443d9f..1aca52ce 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJobResults.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJobResults.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationJobResults; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationJobResults? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationJobResults; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJobStatusUpdate.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJobStatusUpdate.Json.g.cs index f32fcbd4..a62487ad 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJobStatusUpdate.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJobStatusUpdate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationJobStatusUpdate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationJobStatusUpdate? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationJobStatusUpdate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.Json.g.cs index ebdfef81..f2eda5c1 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationJudgeModelConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationJudgeModelConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationJudgeModelConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.g.cs index 0435b848..2ebf86b7 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfig.g.cs @@ -27,7 +27,11 @@ public sealed partial class EvaluationJudgeModelConfig public required string SystemTemplate { get; set; } /// - /// Source of the judge model. + /// Source of the judge model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower).
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs, 20 for proxy/aggregator endpoints. ///
[global::System.Text.Json.Serialization.JsonPropertyName("model_source")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.EvaluationJudgeModelConfigModelSourceJsonConverter))] @@ -35,19 +39,19 @@ public sealed partial class EvaluationJudgeModelConfig public required global::Together.EvaluationJudgeModelConfigModelSource ModelSource { get; set; } /// - /// Bearer/API token for external judge models. + /// Bearer/API token for the external judge model provider. Required when model_source is 'external'. /// [global::System.Text.Json.Serialization.JsonPropertyName("external_api_token")] public string? ExternalApiToken { get; set; } /// - /// Base URL for external judge models. Must be OpenAI-compatible base URL. + /// Base URL of the external inference API for the judge. Must be OpenAI-compatible. Required when model_source is 'external'. /// [global::System.Text.Json.Serialization.JsonPropertyName("external_base_url")] public string? ExternalBaseUrl { get; set; } /// - /// Number of concurrent workers for inference requests. Overrides the default concurrency for this model. Useful for tuning throughput when using proxy endpoints (e.g. OpenRouter) or rate-limited external APIs.
+ /// Number of concurrent inference workers for the judge. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
/// Example: 5 ///
/// 5 @@ -55,7 +59,7 @@ public sealed partial class EvaluationJudgeModelConfig public int? NumWorkers { get; set; } /// - /// Maximum number of tokens the judge model can generate. Defaults to 32768. Increase for reasoning models (e.g. Gemini, o-series) that consume output token budget for chain-of-thought.
+ /// Maximum number of tokens the judge model may generate. Defaults to 32768 if omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend tokens on internal chain-of-thought before emitting the verdict JSON.
/// Example: 8192 ///
/// 8192 @@ -63,12 +67,12 @@ public sealed partial class EvaluationJudgeModelConfig public int? MaxTokens { get; set; } /// - /// Sampling temperature for the judge model. Defaults to 0.05.
- /// Example: 0 + /// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
+ /// Example: 0.0 ///
- /// 0 + /// 0.0 [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -88,25 +92,29 @@ public sealed partial class EvaluationJudgeModelConfig /// Example: Imagine you are a helpful assistant /// /// - /// Source of the judge model. + /// Source of the judge model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower).
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs, 20 for proxy/aggregator endpoints. /// /// - /// Bearer/API token for external judge models. + /// Bearer/API token for the external judge model provider. Required when model_source is 'external'. /// /// - /// Base URL for external judge models. Must be OpenAI-compatible base URL. + /// Base URL of the external inference API for the judge. Must be OpenAI-compatible. Required when model_source is 'external'. /// /// - /// Number of concurrent workers for inference requests. Overrides the default concurrency for this model. Useful for tuning throughput when using proxy endpoints (e.g. OpenRouter) or rate-limited external APIs.
+ /// Number of concurrent inference workers for the judge. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
/// Example: 5 /// /// - /// Maximum number of tokens the judge model can generate. Defaults to 32768. Increase for reasoning models (e.g. Gemini, o-series) that consume output token budget for chain-of-thought.
+ /// Maximum number of tokens the judge model may generate. Defaults to 32768 if omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend tokens on internal chain-of-thought before emitting the verdict JSON.
/// Example: 8192 /// /// - /// Sampling temperature for the judge model. Defaults to 0.05.
- /// Example: 0 + /// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
+ /// Example: 0.0 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -119,7 +127,7 @@ public EvaluationJudgeModelConfig( string? externalBaseUrl, int? numWorkers, int? maxTokens, - float? temperature) + double? temperature) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.SystemTemplate = systemTemplate ?? throw new global::System.ArgumentNullException(nameof(systemTemplate)); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfigModelSource.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfigModelSource.g.cs index 5d3699c2..d7484d59 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfigModelSource.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationJudgeModelConfigModelSource.g.cs @@ -4,20 +4,24 @@ namespace Together { /// - /// Source of the judge model. + /// Source of the judge model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower).
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs, 20 for proxy/aggregator endpoints. ///
public enum EvaluationJudgeModelConfigModelSource { /// - /// + /// - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers /// Dedicated, /// - /// + /// An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter). /// External, /// - /// + /// - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers /// Serverless, } diff --git a/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.Json.g.cs index a2dd5f71..414f45db 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationModelOrString?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationModelOrString? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationModelOrString?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.g.cs index dbde27e0..89478086 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationModelOrString.g.cs @@ -10,7 +10,7 @@ namespace Together public readonly partial struct EvaluationModelOrString : global::System.IEquatable { /// - /// Field name in the input data + /// Column name in the input dataset containing pre-generated responses /// #if NET6_0_OR_GREATER public string? EvaluationModelOrStringVariant1 { get; init; } diff --git a/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.Json.g.cs index 7ece18b6..df3581f4 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationModelRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationModelRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.g.cs index b234b529..b1f9b333 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationModelRequest.g.cs @@ -18,7 +18,7 @@ public sealed partial class EvaluationModelRequest public required string Model { get; set; } /// - /// Maximum number of tokens to generate
+ /// Maximum number of tokens to generate.
/// Example: 512 ///
/// 512 @@ -27,34 +27,39 @@ public sealed partial class EvaluationModelRequest public required int MaxTokens { get; set; } /// - /// Sampling temperature
+ /// Sampling temperature for generation.
/// Example: 0.7 ///
/// 0.7 [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] [global::System.Text.Json.Serialization.JsonRequired] - public required float Temperature { get; set; } + public required double Temperature { get; set; } /// - /// System prompt template
- /// Example: Imagine you are helpful assistant + /// System prompt template. Supports Jinja2 variables referencing dataset columns.
+ /// Example: You are a helpful assistant. ///
- /// Imagine you are helpful assistant + /// You are a helpful assistant. [global::System.Text.Json.Serialization.JsonPropertyName("system_template")] [global::System.Text.Json.Serialization.JsonRequired] public required string SystemTemplate { get; set; } /// - /// Input prompt template
- /// Example: Please classify {{prompt}} based on the labels below + /// User message template. Supports Jinja2 variables referencing dataset columns.
+ /// Example: Please answer the following question: {{ question }} ///
- /// Please classify {{prompt}} based on the labels below + /// Please answer the following question: {{ question }} [global::System.Text.Json.Serialization.JsonPropertyName("input_template")] [global::System.Text.Json.Serialization.JsonRequired] public required string InputTemplate { get; set; } /// - /// Source of the model. + /// Source of the model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower). Authentication uses the requesting
+ /// user's Together API token automatically.
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs (OpenAI, Anthropic, Google), 20 for proxy/aggregator endpoints. ///
[global::System.Text.Json.Serialization.JsonPropertyName("model_source")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.EvaluationModelRequestModelSourceJsonConverter))] @@ -62,19 +67,19 @@ public sealed partial class EvaluationModelRequest public required global::Together.EvaluationModelRequestModelSource ModelSource { get; set; } /// - /// Bearer/API token for external models. + /// Bearer/API token for the external model provider. Required when model_source is 'external'. /// [global::System.Text.Json.Serialization.JsonPropertyName("external_api_token")] public string? ExternalApiToken { get; set; } /// - /// Base URL for external models. Must be OpenAI-compatible base URL + /// Base URL of the external inference API. Must be OpenAI-compatible. Required when model_source is 'external'. /// [global::System.Text.Json.Serialization.JsonPropertyName("external_base_url")] public string? ExternalBaseUrl { get; set; } /// - /// Number of concurrent workers for inference requests. Overrides the default concurrency for this model. Useful for tuning throughput when using proxy endpoints (e.g. OpenRouter) or rate-limited external APIs.
+ /// Number of concurrent inference workers. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
/// Example: 5 ///
/// 5 @@ -95,32 +100,37 @@ public sealed partial class EvaluationModelRequest /// Example: Qwen/Qwen3.5-9B /// /// - /// Maximum number of tokens to generate
+ /// Maximum number of tokens to generate.
/// Example: 512 /// /// - /// Sampling temperature
+ /// Sampling temperature for generation.
/// Example: 0.7 /// /// - /// System prompt template
- /// Example: Imagine you are helpful assistant + /// System prompt template. Supports Jinja2 variables referencing dataset columns.
+ /// Example: You are a helpful assistant. /// /// - /// Input prompt template
- /// Example: Please classify {{prompt}} based on the labels below + /// User message template. Supports Jinja2 variables referencing dataset columns.
+ /// Example: Please answer the following question: {{ question }} /// /// - /// Source of the model. + /// Source of the model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower). Authentication uses the requesting
+ /// user's Together API token automatically.
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs (OpenAI, Anthropic, Google), 20 for proxy/aggregator endpoints. /// /// - /// Bearer/API token for external models. + /// Bearer/API token for the external model provider. Required when model_source is 'external'. /// /// - /// Base URL for external models. Must be OpenAI-compatible base URL + /// Base URL of the external inference API. Must be OpenAI-compatible. Required when model_source is 'external'. /// /// - /// Number of concurrent workers for inference requests. Overrides the default concurrency for this model. Useful for tuning throughput when using proxy endpoints (e.g. OpenRouter) or rate-limited external APIs.
+ /// Number of concurrent inference workers. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
/// Example: 5 /// #if NET7_0_OR_GREATER @@ -129,7 +139,7 @@ public sealed partial class EvaluationModelRequest public EvaluationModelRequest( string model, int maxTokens, - float temperature, + double temperature, string systemTemplate, string inputTemplate, global::Together.EvaluationModelRequestModelSource modelSource, diff --git a/src/libs/Together/Generated/Together.Models.EvaluationModelRequestModelSource.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationModelRequestModelSource.g.cs index 64dd2d3f..78421a82 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationModelRequestModelSource.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationModelRequestModelSource.g.cs @@ -4,20 +4,25 @@ namespace Together { /// - /// Source of the model. + /// Source of the model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
+ /// (minimum enforced even if num_workers is set lower). Authentication uses the requesting
+ /// user's Together API token automatically.
+ /// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
+ /// Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
+ /// for first-party APIs (OpenAI, Anthropic, Google), 20 for proxy/aggregator endpoints. ///
public enum EvaluationModelRequestModelSource { /// - /// + /// - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers /// Dedicated, /// - /// + /// An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter). /// External, /// - /// + /// - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers /// Serverless, } diff --git a/src/libs/Together/Generated/Together.Models.EvaluationResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationResponse.Json.g.cs index 1ae89856..89dd2d3c 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.Json.g.cs index 0c0e8159..faccbbc6 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationScoreParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationScoreParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationScoreParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.g.cs index 4c32a5a5..18e79fea 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationScoreParameters.g.cs @@ -17,30 +17,30 @@ public sealed partial class EvaluationScoreParameters /// /// Minimum possible score
- /// Example: 0 + /// Example: 0.0 ///
- /// 0 + /// 0.0 [global::System.Text.Json.Serialization.JsonPropertyName("min_score")] [global::System.Text.Json.Serialization.JsonRequired] - public required float MinScore { get; set; } + public required double MinScore { get; set; } /// /// Maximum possible score
- /// Example: 10 + /// Example: 10.0 ///
- /// 10 + /// 10.0 [global::System.Text.Json.Serialization.JsonPropertyName("max_score")] [global::System.Text.Json.Serialization.JsonRequired] - public required float MaxScore { get; set; } + public required double MaxScore { get; set; } /// /// Score threshold for passing
- /// Example: 7 + /// Example: 7.0 ///
- /// 7 + /// 7.0 [global::System.Text.Json.Serialization.JsonPropertyName("pass_threshold")] [global::System.Text.Json.Serialization.JsonRequired] - public required float PassThreshold { get; set; } + public required double PassThreshold { get; set; } /// /// @@ -70,15 +70,15 @@ public sealed partial class EvaluationScoreParameters /// /// /// Minimum possible score
- /// Example: 0 + /// Example: 0.0 /// /// /// Maximum possible score
- /// Example: 10 + /// Example: 10.0 /// /// /// Score threshold for passing
- /// Example: 7 + /// Example: 7.0 /// /// /// Data file ID
@@ -90,9 +90,9 @@ public sealed partial class EvaluationScoreParameters #endif public EvaluationScoreParameters( global::Together.EvaluationJudgeModelConfig judge, - float minScore, - float maxScore, - float passThreshold, + double minScore, + double maxScore, + double passThreshold, string inputDataFilePath, global::Together.EvaluationModelOrString? modelToEvaluate) { diff --git a/src/libs/Together/Generated/Together.Models.EvaluationScoreResults.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationScoreResults.Json.g.cs index 3ee8947b..c3a54f2b 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationScoreResults.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationScoreResults.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationScoreResults; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationScoreResults? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationScoreResults; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.Json.g.cs index 8aa283a6..522ca2da 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationScoreResultsAggregatedScores; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationScoreResultsAggregatedScores? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationScoreResultsAggregatedScores; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.g.cs index 4e7bf9ed..76adf842 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationScoreResultsAggregatedScores.g.cs @@ -12,19 +12,19 @@ public sealed partial class EvaluationScoreResultsAggregatedScores /// ///
[global::System.Text.Json.Serialization.JsonPropertyName("mean_score")] - public float? MeanScore { get; set; } + public double? MeanScore { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("std_score")] - public float? StdScore { get; set; } + public double? StdScore { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pass_percentage")] - public float? PassPercentage { get; set; } + public double? PassPercentage { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -42,9 +42,9 @@ public sealed partial class EvaluationScoreResultsAggregatedScores [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public EvaluationScoreResultsAggregatedScores( - float? meanScore, - float? stdScore, - float? passPercentage) + double? meanScore, + double? stdScore, + double? passPercentage) { this.MeanScore = meanScore; this.StdScore = stdScore; diff --git a/src/libs/Together/Generated/Together.Models.EvaluationTypedRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.EvaluationTypedRequest.Json.g.cs index 74111732..cd746952 100644 --- a/src/libs/Together/Generated/Together.Models.EvaluationTypedRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EvaluationTypedRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.EvaluationTypedRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.EvaluationTypedRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.EvaluationTypedRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs index 7f3c12c3..d27f42cb 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs index ae28397c..fb2c1bb1 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteRequestFile; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteRequestFile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteRequestFile; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs index 7e7090c4..f501a2b0 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponse?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponse?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs index bc4e705b..a9752870 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseFailedExecution; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecution? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseFailedExecution; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs index d436cc70..de46e32c 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseFailedExecutionError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecutionError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseFailedExecutionError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs index 9d2d0d5f..c274f133 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecution; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecution? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecution; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs index dbb49daa..2d781770 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs index a7d89989..d7382535 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs index b7f3b232..ff3e66ed 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs index 37dabe76..cd602ece 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs index a2cc3021..d22cbf4a 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs index 78a5043b..f06d647e 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs index c0b7a9a4..b1fe79e3 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs index 5536f877..9c935b10 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs index b7c80ebf..d4b83bb6 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs index 2265cc51..6276f4cc 100644 --- a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileDeleteResponse.Json.g.cs index 3ee5ef49..b565392e 100644 --- a/src/libs/Together/Generated/Together.Models.FileDeleteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FileDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileInfo.Json.g.cs index bb326c34..5a8c1afb 100644 --- a/src/libs/Together/Generated/Together.Models.FileInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FileInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileList.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileList.Json.g.cs index 8f4999bb..729a0923 100644 --- a/src/libs/Together/Generated/Together.Models.FileList.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileList.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FileList; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileList? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileList; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileProcessingStatus.g.cs b/src/libs/Together/Generated/Together.Models.FileProcessingStatus.g.cs new file mode 100644 index 00000000..a579d10f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FileProcessingStatus.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Together +{ + /// + /// Lifecycle state of a file in the validation pipeline. The typical
+ /// progression is `PENDING` → `QUEUED` → `RUNNING` → `COMPLETED` /
+ /// `FAILED`. `INVALID_FORMAT` is a terminal state for files whose
+ /// contents failed validation in a user-correctable way. + ///
+ public enum FileProcessingStatus + { + /// + /// + /// + Completed, + /// + /// + /// + Failed, + /// + /// + /// + InvalidFormat, + /// + /// + /// + Pending, + /// + /// + /// + Queued, + /// + /// + /// + Running, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class FileProcessingStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this FileProcessingStatus value) + { + return value switch + { + FileProcessingStatus.Completed => "COMPLETED", + FileProcessingStatus.Failed => "FAILED", + FileProcessingStatus.InvalidFormat => "INVALID_FORMAT", + FileProcessingStatus.Pending => "PENDING", + FileProcessingStatus.Queued => "QUEUED", + FileProcessingStatus.Running => "RUNNING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static FileProcessingStatus? ToEnum(string value) + { + return value switch + { + "COMPLETED" => FileProcessingStatus.Completed, + "FAILED" => FileProcessingStatus.Failed, + "INVALID_FORMAT" => FileProcessingStatus.InvalidFormat, + "PENDING" => FileProcessingStatus.Pending, + "QUEUED" => FileProcessingStatus.Queued, + "RUNNING" => FileProcessingStatus.Running, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FileResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileResponse.Json.g.cs index c4c63b24..91afd8c6 100644 --- a/src/libs/Together/Generated/Together.Models.FileResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FileResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileResponse.g.cs b/src/libs/Together/Generated/Together.Models.FileResponse.g.cs index a98f2dad..8473c745 100644 --- a/src/libs/Together/Generated/Together.Models.FileResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileResponse.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -56,7 +58,7 @@ public sealed partial class FileResponse public required global::Together.FilePurpose Purpose { get; set; } /// - /// Whether the file has been parsed and analyzed for correctness for fine-tuning. + /// Deprecated. Whether file has been fully uploaded. /// [global::System.Text.Json.Serialization.JsonPropertyName("Processed")] [global::System.Text.Json.Serialization.JsonRequired] @@ -74,6 +76,22 @@ public sealed partial class FileResponse [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.FileType FileType { get; set; } = global::Together.FileType.Jsonl; + /// + /// Lifecycle state of the file validation pipeline. Files for
+ /// non-`fine-tune` purposes skip validation. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("processing_status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.FileProcessingStatusJsonConverter))] + public global::Together.FileProcessingStatus? ProcessingStatus { get; set; } + + /// + /// Report produced by the file validation pipeline. Present once
+ /// validation has run; absent on files that bypassed validation
+ /// (non-`fine-tune` purposes) or have not yet been validated. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("validation_report")] + public global::Together.FileValidationReport? ValidationReport { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -101,13 +119,22 @@ public sealed partial class FileResponse /// Example: fine-tune /// /// - /// Whether the file has been parsed and analyzed for correctness for fine-tuning. + /// Deprecated. Whether file has been fully uploaded. /// /// /// The type of the file such as `jsonl`, `csv`, or `parquet`.
/// Default Value: jsonl
/// Example: jsonl /// + /// + /// Lifecycle state of the file validation pipeline. Files for
+ /// non-`fine-tune` purposes skip validation. + /// + /// + /// Report produced by the file validation pipeline. Present once
+ /// validation has run; absent on files that bypassed validation
+ /// (non-`fine-tune` purposes) or have not yet been validated. + /// /// /// The object type, which is always `file`. /// @@ -122,6 +149,8 @@ public FileResponse( global::Together.FilePurpose purpose, bool processed, global::Together.FileType fileType, + global::Together.FileProcessingStatus? processingStatus, + global::Together.FileValidationReport? validationReport, string @object = "file") { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); @@ -132,6 +161,8 @@ public FileResponse( this.Purpose = purpose; this.Processed = processed; this.FileType = fileType; + this.ProcessingStatus = processingStatus; + this.ValidationReport = validationReport; } /// diff --git a/src/libs/Together/Generated/Together.Models.FileResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileResponseObject.Json.g.cs index 2bf0c3bd..b25ce422 100644 --- a/src/libs/Together/Generated/Together.Models.FileResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FileResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FileValidationReport.Json.g.cs b/src/libs/Together/Generated/Together.Models.FileValidationReport.Json.g.cs new file mode 100644 index 00000000..7fc0e3da --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FileValidationReport.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FileValidationReport + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FileValidationReport? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FileValidationReport), + jsonSerializerContext) as global::Together.FileValidationReport; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FileValidationReport? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FileValidationReport? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FileValidationReport), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FileValidationReport; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FileValidationReport.g.cs b/src/libs/Together/Generated/Together.Models.FileValidationReport.g.cs new file mode 100644 index 00000000..e3e4e0c0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FileValidationReport.g.cs @@ -0,0 +1,172 @@ + +#nullable enable + +namespace Together +{ + /// + /// Validation outcome for a fine-tune training file, produced by the
+ /// file validation pipeline. + ///
+ public sealed partial class FileValidationReport + { + /// + /// Whether the file passed validation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("valid")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Valid { get; set; } + + /// + /// Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_format")] + public string? DatasetFormat { get; set; } + + /// + /// Whether the dataset carries per-sample weights. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_has_sample_weights")] + public bool? DatasetHasSampleWeights { get; set; } + + /// + /// Whether the dataset carries per-message weights (only possible for `CONVERSATION` format). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_has_message_weights")] + public bool? DatasetHasMessageWeights { get; set; } + + /// + /// Whether the dataset contains multimodal content. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_is_multimodal")] + public bool? DatasetIsMultimodal { get; set; } + + /// + /// Whether the dataset contains tool-use messages. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_has_tools")] + public bool? DatasetHasTools { get; set; } + + /// + /// Whether the dataset contains parallel tool-use messages. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_has_parallel_tool_calls")] + public bool? DatasetHasParallelToolCalls { get; set; } + + /// + /// Whether the dataset contains reasoning content. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_has_reasoning")] + public bool? DatasetHasReasoning { get; set; } + + /// + /// Number of lines (records) in the dataset. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nlines")] + public int? Nlines { get; set; } + + /// + /// ID of the file this report describes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("file_id")] + public string? FileId { get; set; } + + /// + /// Category of validation failure. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter))] + public global::Together.FileValidationReportErrorType? ErrorType { get; set; } + + /// + /// Human-readable validation error message. Only present when
+ /// `error_type` is set (i.e. user-correctable failures). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public string? Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the file passed validation. + /// + /// + /// Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`). + /// + /// + /// Whether the dataset carries per-sample weights. + /// + /// + /// Whether the dataset carries per-message weights (only possible for `CONVERSATION` format). + /// + /// + /// Whether the dataset contains multimodal content. + /// + /// + /// Whether the dataset contains tool-use messages. + /// + /// + /// Whether the dataset contains parallel tool-use messages. + /// + /// + /// Whether the dataset contains reasoning content. + /// + /// + /// Number of lines (records) in the dataset. + /// + /// + /// ID of the file this report describes. + /// + /// + /// Category of validation failure. + /// + /// + /// Human-readable validation error message. Only present when
+ /// `error_type` is set (i.e. user-correctable failures). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FileValidationReport( + bool valid, + string? datasetFormat, + bool? datasetHasSampleWeights, + bool? datasetHasMessageWeights, + bool? datasetIsMultimodal, + bool? datasetHasTools, + bool? datasetHasParallelToolCalls, + bool? datasetHasReasoning, + int? nlines, + string? fileId, + global::Together.FileValidationReportErrorType? errorType, + string? error) + { + this.Valid = valid; + this.DatasetFormat = datasetFormat; + this.DatasetHasSampleWeights = datasetHasSampleWeights; + this.DatasetHasMessageWeights = datasetHasMessageWeights; + this.DatasetIsMultimodal = datasetIsMultimodal; + this.DatasetHasTools = datasetHasTools; + this.DatasetHasParallelToolCalls = datasetHasParallelToolCalls; + this.DatasetHasReasoning = datasetHasReasoning; + this.Nlines = nlines; + this.FileId = fileId; + this.ErrorType = errorType; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public FileValidationReport() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FileValidationReportErrorType.g.cs b/src/libs/Together/Generated/Together.Models.FileValidationReportErrorType.g.cs new file mode 100644 index 00000000..db276789 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FileValidationReportErrorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// Category of validation failure. + /// + public enum FileValidationReportErrorType + { + /// + /// + /// + InvalidFormat, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class FileValidationReportErrorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this FileValidationReportErrorType value) + { + return value switch + { + FileValidationReportErrorType.InvalidFormat => "INVALID_FORMAT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static FileValidationReportErrorType? ToEnum(string value) + { + return value switch + { + "INVALID_FORMAT" => FileValidationReportErrorType.InvalidFormat, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.Json.g.cs index ead2e01d..73b7da0b 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneCheckpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneCheckpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneCheckpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.g.cs index 339ca0a4..7dc5c458 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneCheckpoint.g.cs @@ -4,38 +4,63 @@ namespace Together { /// - /// + /// A checkpoint available for a fine-tuning job. /// public sealed partial class FineTuneCheckpoint { /// - /// + /// Step represented by the checkpoint; final checkpoints use the shipped model step. /// [global::System.Text.Json.Serialization.JsonPropertyName("step")] [global::System.Text.Json.Serialization.JsonRequired] public required int Step { get; set; } /// - /// + /// Timestamp when the checkpoint was created. /// [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] [global::System.Text.Json.Serialization.JsonRequired] public required string CreatedAt { get; set; } /// - /// + /// Storage path for the checkpoint artifact. /// [global::System.Text.Json.Serialization.JsonPropertyName("path")] [global::System.Text.Json.Serialization.JsonRequired] public required string Path { get; set; } /// - /// + /// Display label for the checkpoint, including the final or intermediate checkpoint step. /// [global::System.Text.Json.Serialization.JsonPropertyName("checkpoint_type")] [global::System.Text.Json.Serialization.JsonRequired] public required string CheckpointType { get; set; } + /// + /// Canonical artifact selector for checkpoint download requests. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("checkpoint")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter))] + public global::Together.FineTuneCheckpointCheckpoint? Checkpoint { get; set; } + + /// + /// Together model registry object ID for the checkpoint artifact (e.g. `ml_...`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_id")] + public string? ObjectId { get; set; } + + /// + /// Together model registry name for the checkpoint artifact, formatted as `<project_slug>/<checkpoint_name>`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_name")] + public string? ObjectName { get; set; } + + /// + /// Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_revision_id")] + public string? ObjectRevisionId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -45,10 +70,30 @@ public sealed partial class FineTuneCheckpoint /// /// Initializes a new instance of the class. /// - /// - /// - /// - /// + /// + /// Step represented by the checkpoint; final checkpoints use the shipped model step. + /// + /// + /// Timestamp when the checkpoint was created. + /// + /// + /// Storage path for the checkpoint artifact. + /// + /// + /// Display label for the checkpoint, including the final or intermediate checkpoint step. + /// + /// + /// Canonical artifact selector for checkpoint download requests. + /// + /// + /// Together model registry object ID for the checkpoint artifact (e.g. `ml_...`). + /// + /// + /// Together model registry name for the checkpoint artifact, formatted as `<project_slug>/<checkpoint_name>`. + /// + /// + /// Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`). + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -56,12 +101,20 @@ public FineTuneCheckpoint( int step, string createdAt, string path, - string checkpointType) + string checkpointType, + global::Together.FineTuneCheckpointCheckpoint? checkpoint, + string? objectId, + string? objectName, + string? objectRevisionId) { this.Step = step; this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); this.Path = path ?? throw new global::System.ArgumentNullException(nameof(path)); this.CheckpointType = checkpointType ?? throw new global::System.ArgumentNullException(nameof(checkpointType)); + this.Checkpoint = checkpoint; + this.ObjectId = objectId; + this.ObjectName = objectName; + this.ObjectRevisionId = objectRevisionId; } /// diff --git a/src/libs/Together/Generated/Together.Models.FineTuneCheckpointCheckpoint.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneCheckpointCheckpoint.g.cs new file mode 100644 index 00000000..c8a80ec3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTuneCheckpointCheckpoint.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Canonical artifact selector for checkpoint download requests. + /// + public enum FineTuneCheckpointCheckpoint + { + /// + /// + /// + Adapter, + /// + /// + /// + Model, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class FineTuneCheckpointCheckpointExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this FineTuneCheckpointCheckpoint value) + { + return value switch + { + FineTuneCheckpointCheckpoint.Adapter => "adapter", + FineTuneCheckpointCheckpoint.Model => "model", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static FineTuneCheckpointCheckpoint? ToEnum(string value) + { + return value switch + { + "adapter" => FineTuneCheckpointCheckpoint.Adapter, + "model" => FineTuneCheckpointCheckpoint.Model, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTuneEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneEvent.Json.g.cs index 0d3b2368..62f2ffea 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTuneEvent.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneEvent.g.cs index a2bf192b..f92d3bff 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneEvent.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneEvent.g.cs @@ -48,64 +48,55 @@ public sealed partial class FineTuneEvent /// /// [global::System.Text.Json.Serialization.JsonPropertyName("param_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int ParamCount { get; set; } + public int? ParamCount { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("token_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int TokenCount { get; set; } + public int? TokenCount { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("total_steps")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int TotalSteps { get; set; } + public int? TotalSteps { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("wandb_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string WandbUrl { get; set; } + public string? WandbUrl { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("step")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Step { get; set; } + public int? Step { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("checkpoint_path")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CheckpointPath { get; set; } + public string? CheckpointPath { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("model_path")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelPath { get; set; } + public string? ModelPath { get; set; } /// - /// + /// For early_stopped events, the selected best-checkpoint step when a finite best metric exists. If early_stopping_best_metric_value is null, this is the halt step. /// - [global::System.Text.Json.Serialization.JsonPropertyName("training_offset")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int TrainingOffset { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_step")] + public int? EarlyStoppingBestStep { get; set; } /// - /// + /// For early_stopped events, the best validation loss observed. Null if no improving evaluation was recorded. /// - [global::System.Text.Json.Serialization.JsonPropertyName("hash")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Hash { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_metric_value")] + public double? EarlyStoppingBestMetricValue { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -119,6 +110,7 @@ public sealed partial class FineTuneEvent /// /// /// + /// /// /// /// @@ -126,9 +118,12 @@ public sealed partial class FineTuneEvent /// /// /// - /// - /// - /// + /// + /// For early_stopped events, the selected best-checkpoint step when a finite best metric exists. If early_stopping_best_metric_value is null, this is the halt step. + /// + /// + /// For early_stopped events, the best validation loss observed. Null if no improving evaluation was recorded. + /// /// /// The object type, which is always `fine-tune-event`. /// @@ -139,16 +134,16 @@ public FineTuneEvent( string createdAt, string message, global::Together.FinetuneEventType type, - int paramCount, - int tokenCount, - int totalSteps, - string wandbUrl, - int step, - string checkpointPath, - string modelPath, - int trainingOffset, - string hash, global::Together.FinetuneEventLevels? level, + int? paramCount, + int? tokenCount, + int? totalSteps, + string? wandbUrl, + int? step, + string? checkpointPath, + string? modelPath, + int? earlyStoppingBestStep, + double? earlyStoppingBestMetricValue, string @object = "fine-tune-event") { this.Object = @object; @@ -159,12 +154,12 @@ public FineTuneEvent( this.ParamCount = paramCount; this.TokenCount = tokenCount; this.TotalSteps = totalSteps; - this.WandbUrl = wandbUrl ?? throw new global::System.ArgumentNullException(nameof(wandbUrl)); + this.WandbUrl = wandbUrl; this.Step = step; - this.CheckpointPath = checkpointPath ?? throw new global::System.ArgumentNullException(nameof(checkpointPath)); - this.ModelPath = modelPath ?? throw new global::System.ArgumentNullException(nameof(modelPath)); - this.TrainingOffset = trainingOffset; - this.Hash = hash ?? throw new global::System.ArgumentNullException(nameof(hash)); + this.CheckpointPath = checkpointPath; + this.ModelPath = modelPath; + this.EarlyStoppingBestStep = earlyStoppingBestStep; + this.EarlyStoppingBestMetricValue = earlyStoppingBestMetricValue; } /// diff --git a/src/libs/Together/Generated/Together.Models.FineTuneEventObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneEventObject.Json.g.cs index a201e3f1..878a86da 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneEventObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneEventObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneEventObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneEventObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneEventObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.Json.g.cs index f78a8eb5..eb44d62d 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneModelLimits; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneModelLimits? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneModelLimits; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.g.cs index f87d7b87..7b68c570 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneModelLimits.g.cs @@ -25,7 +25,8 @@ public sealed partial class FineTuneModelLimits /// Limits for LoRA training. /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_training")] - public global::Together.FineTuneModelLimitsLoraTraining? LoraTraining { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.FineTuneModelLimitsLoraTraining LoraTraining { get; set; } /// /// Maximum number of training epochs. @@ -55,6 +56,13 @@ public sealed partial class FineTuneModelLimits [global::System.Text.Json.Serialization.JsonRequired] public required double MinLearningRate { get; set; } + /// + /// Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA fine-tuning is available and the full_training limits are reported as zero. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("supports_full_training")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool SupportsFullTraining { get; set; } + /// /// Whether the model supports vision/multimodal inputs. /// @@ -77,12 +85,47 @@ public sealed partial class FineTuneModelLimits public required bool SupportsReasoning { get; set; } /// - /// Whether to merge the output LoRA. + /// Whether a merged checkpoint (the base model with the trained LoRA adapter fused in) is produced for LoRA fine-tunes of this model, in addition to the standalone adapter. /// [global::System.Text.Json.Serialization.JsonPropertyName("merge_output_lora")] [global::System.Text.Json.Serialization.JsonRequired] public required bool MergeOutputLora { get; set; } + /// + /// Default gradient accumulation steps used when a fine-tune request omits the value or sets it to 0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_gradient_accumulation_steps")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int DefaultGradientAccumulationSteps { get; set; } + + /// + /// Maximum number of checkpoints that can be saved during a fine-tuning job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_num_checkpoints")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxNumCheckpoints { get; set; } + + /// + /// Minimum value allowed for the max_seq_length hyperparameter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("min_max_seq_length")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MinMaxSeqLength { get; set; } + + /// + /// Maximum sequence length supported for SFT training. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_seq_length_sft")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxSeqLengthSft { get; set; } + + /// + /// Maximum sequence length supported for DPO training. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_seq_length_dpo")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxSeqLengthDpo { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -95,6 +138,9 @@ public sealed partial class FineTuneModelLimits /// /// The name of the model. /// + /// + /// Limits for LoRA training. + /// /// /// Maximum number of training epochs. /// @@ -107,6 +153,9 @@ public sealed partial class FineTuneModelLimits /// /// Minimum learning rate. /// + /// + /// Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA fine-tuning is available and the full_training limits are reported as zero. + /// /// /// Whether the model supports vision/multimodal inputs. /// @@ -117,41 +166,65 @@ public sealed partial class FineTuneModelLimits /// Whether the model supports reasoning. /// /// - /// Whether to merge the output LoRA. + /// Whether a merged checkpoint (the base model with the trained LoRA adapter fused in) is produced for LoRA fine-tunes of this model, in addition to the standalone adapter. + /// + /// + /// Default gradient accumulation steps used when a fine-tune request omits the value or sets it to 0. + /// + /// + /// Maximum number of checkpoints that can be saved during a fine-tuning job. + /// + /// + /// Minimum value allowed for the max_seq_length hyperparameter. + /// + /// + /// Maximum sequence length supported for SFT training. + /// + /// + /// Maximum sequence length supported for DPO training. /// /// /// Limits for full training. /// - /// - /// Limits for LoRA training. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FineTuneModelLimits( string modelName, + global::Together.FineTuneModelLimitsLoraTraining loraTraining, int maxNumEpochs, int maxNumEvals, double maxLearningRate, double minLearningRate, + bool supportsFullTraining, bool supportsVision, bool supportsTools, bool supportsReasoning, bool mergeOutputLora, - global::Together.FineTuneModelLimitsFullTraining? fullTraining, - global::Together.FineTuneModelLimitsLoraTraining? loraTraining) + int defaultGradientAccumulationSteps, + int maxNumCheckpoints, + int minMaxSeqLength, + int maxSeqLengthSft, + int maxSeqLengthDpo, + global::Together.FineTuneModelLimitsFullTraining? fullTraining) { this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); this.FullTraining = fullTraining; - this.LoraTraining = loraTraining; + this.LoraTraining = loraTraining ?? throw new global::System.ArgumentNullException(nameof(loraTraining)); this.MaxNumEpochs = maxNumEpochs; this.MaxNumEvals = maxNumEvals; this.MaxLearningRate = maxLearningRate; this.MinLearningRate = minLearningRate; + this.SupportsFullTraining = supportsFullTraining; this.SupportsVision = supportsVision; this.SupportsTools = supportsTools; this.SupportsReasoning = supportsReasoning; this.MergeOutputLora = mergeOutputLora; + this.DefaultGradientAccumulationSteps = defaultGradientAccumulationSteps; + this.MaxNumCheckpoints = maxNumCheckpoints; + this.MinMaxSeqLength = minMaxSeqLength; + this.MaxSeqLengthSft = maxSeqLengthSft; + this.MaxSeqLengthDpo = maxSeqLengthDpo; } /// diff --git a/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsFullTraining.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsFullTraining.Json.g.cs index 948efe47..14831117 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsFullTraining.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsFullTraining.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneModelLimitsFullTraining; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneModelLimitsFullTraining? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneModelLimitsFullTraining; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsLoraTraining.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsLoraTraining.Json.g.cs index 8a456c96..8c98c755 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsLoraTraining.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneModelLimitsLoraTraining.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneModelLimitsLoraTraining; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneModelLimitsLoraTraining? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneModelLimitsLoraTraining; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.Json.g.cs new file mode 100644 index 00000000..bd83a145 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FineTunePreviewDetailError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FineTunePreviewDetailError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FineTunePreviewDetailError), + jsonSerializerContext) as global::Together.FineTunePreviewDetailError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTunePreviewDetailError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FineTunePreviewDetailError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FineTunePreviewDetailError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTunePreviewDetailError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.g.cs new file mode 100644 index 00000000..6a0eb9cd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewDetailError.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Error response with a detail field returned by the preview tokenization service. + /// + public sealed partial class FineTunePreviewDetailError + { + /// + /// Human-readable error detail. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("detail")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Detail { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable error detail. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FineTunePreviewDetailError( + string detail) + { + this.Detail = detail ?? throw new global::System.ArgumentNullException(nameof(detail)); + } + + /// + /// Initializes a new instance of the class. + /// + public FineTunePreviewDetailError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.Json.g.cs new file mode 100644 index 00000000..0a80c606 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FineTunePreviewMessageError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FineTunePreviewMessageError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FineTunePreviewMessageError), + jsonSerializerContext) as global::Together.FineTunePreviewMessageError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTunePreviewMessageError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FineTunePreviewMessageError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FineTunePreviewMessageError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTunePreviewMessageError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.g.cs new file mode 100644 index 00000000..152956b9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewMessageError.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Error response with a message field returned by the fine-tuning API layer. + /// + public sealed partial class FineTunePreviewMessageError + { + /// + /// Human-readable error message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable error message. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FineTunePreviewMessageError( + string message) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + } + + /// + /// Initializes a new instance of the class. + /// + public FineTunePreviewMessageError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.Json.g.cs new file mode 100644 index 00000000..ee75adb4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FineTunePreviewRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FineTunePreviewRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FineTunePreviewRequest), + jsonSerializerContext) as global::Together.FineTunePreviewRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTunePreviewRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FineTunePreviewRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FineTunePreviewRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTunePreviewRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.g.cs new file mode 100644 index 00000000..72753a7c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequest.g.cs @@ -0,0 +1,99 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request body for previewing tokenized fine-tuning data. + /// + public sealed partial class FineTunePreviewRequest + { + /// + /// Name of the base model whose tokenizer and chat template will be used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// File-ID of the uploaded JSONL training file to sample for preview. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("training_file")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TrainingFile { get; set; } + + /// + /// Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
+ /// Default Value: sft + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("training_method")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter))] + public global::Together.FineTunePreviewRequestTrainingMethod? TrainingMethod { get; set; } + + /// + /// Whether prompt or user-message tokens should contribute to training loss in the preview.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("train_on_inputs")] + public bool? TrainOnInputs { get; set; } + + /// + /// Maximum number of rows from the start of the training file to tokenize.
+ /// Default Value: 5 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("top_k")] + public int? TopK { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name of the base model whose tokenizer and chat template will be used. + /// + /// + /// File-ID of the uploaded JSONL training file to sample for preview. + /// + /// + /// Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
+ /// Default Value: sft + /// + /// + /// Whether prompt or user-message tokens should contribute to training loss in the preview.
+ /// Default Value: false + /// + /// + /// Maximum number of rows from the start of the training file to tokenize.
+ /// Default Value: 5 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FineTunePreviewRequest( + string model, + string trainingFile, + global::Together.FineTunePreviewRequestTrainingMethod? trainingMethod, + bool? trainOnInputs, + int? topK) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.TrainingFile = trainingFile ?? throw new global::System.ArgumentNullException(nameof(trainingFile)); + this.TrainingMethod = trainingMethod; + this.TrainOnInputs = trainOnInputs; + this.TopK = topK; + } + + /// + /// Initializes a new instance of the class. + /// + public FineTunePreviewRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewRequestTrainingMethod.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequestTrainingMethod.g.cs new file mode 100644 index 00000000..408fb652 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewRequestTrainingMethod.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
+ /// Default Value: sft + ///
+ public enum FineTunePreviewRequestTrainingMethod + { + /// + /// + /// + Sft, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class FineTunePreviewRequestTrainingMethodExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this FineTunePreviewRequestTrainingMethod value) + { + return value switch + { + FineTunePreviewRequestTrainingMethod.Sft => "sft", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static FineTunePreviewRequestTrainingMethod? ToEnum(string value) + { + return value switch + { + "sft" => FineTunePreviewRequestTrainingMethod.Sft, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.Json.g.cs new file mode 100644 index 00000000..2342c6e6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FineTunePreviewResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FineTunePreviewResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FineTunePreviewResponse), + jsonSerializerContext) as global::Together.FineTunePreviewResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTunePreviewResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FineTunePreviewResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FineTunePreviewResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTunePreviewResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.g.cs new file mode 100644 index 00000000..c8682bcd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponse.g.cs @@ -0,0 +1,96 @@ + +#nullable enable + +namespace Together +{ + /// + /// Tokenized preview for sampled rows from a fine-tuning training file. + /// + public sealed partial class FineTunePreviewResponse + { + /// + /// Name of the base model used to tokenize the sampled rows. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Detected SFT dataset format for the sampled rows. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_format")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.FineTunePreviewResponseDatasetFormat DatasetFormat { get; set; } + + /// + /// Maximum sequence length configured for the requested model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_seq_length")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxSeqLength { get; set; } + + /// + /// Whether prompt or user-message tokens contribute to training loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("train_on_inputs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool TrainOnInputs { get; set; } + + /// + /// Tokenized preview rows, in the same order as the sampled training file rows. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rows")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Rows { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name of the base model used to tokenize the sampled rows. + /// + /// + /// Detected SFT dataset format for the sampled rows. + /// + /// + /// Maximum sequence length configured for the requested model. + /// + /// + /// Whether prompt or user-message tokens contribute to training loss. + /// + /// + /// Tokenized preview rows, in the same order as the sampled training file rows. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FineTunePreviewResponse( + string model, + global::Together.FineTunePreviewResponseDatasetFormat datasetFormat, + int maxSeqLength, + bool trainOnInputs, + global::System.Collections.Generic.IList rows) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.DatasetFormat = datasetFormat; + this.MaxSeqLength = maxSeqLength; + this.TrainOnInputs = trainOnInputs; + this.Rows = rows ?? throw new global::System.ArgumentNullException(nameof(rows)); + } + + /// + /// Initializes a new instance of the class. + /// + public FineTunePreviewResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewResponseDatasetFormat.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponseDatasetFormat.g.cs new file mode 100644 index 00000000..89ccf80e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewResponseDatasetFormat.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Detected SFT dataset format for the sampled rows. + /// + public enum FineTunePreviewResponseDatasetFormat + { + /// + /// + /// + Conversation, + /// + /// + /// + General, + /// + /// + /// + Instruction, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class FineTunePreviewResponseDatasetFormatExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this FineTunePreviewResponseDatasetFormat value) + { + return value switch + { + FineTunePreviewResponseDatasetFormat.Conversation => "conversation", + FineTunePreviewResponseDatasetFormat.General => "general", + FineTunePreviewResponseDatasetFormat.Instruction => "instruction", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static FineTunePreviewResponseDatasetFormat? ToEnum(string value) + { + return value switch + { + "conversation" => FineTunePreviewResponseDatasetFormat.Conversation, + "general" => FineTunePreviewResponseDatasetFormat.General, + "instruction" => FineTunePreviewResponseDatasetFormat.Instruction, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.Json.g.cs new file mode 100644 index 00000000..1e522c32 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class FineTunePreviewRow + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.FineTunePreviewRow? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.FineTunePreviewRow), + jsonSerializerContext) as global::Together.FineTunePreviewRow; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTunePreviewRow? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.FineTunePreviewRow? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.FineTunePreviewRow), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTunePreviewRow; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.g.cs b/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.g.cs new file mode 100644 index 00000000..1d63555a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.FineTunePreviewRow.g.cs @@ -0,0 +1,119 @@ + +#nullable enable + +namespace Together +{ + /// + /// Tokenized representation of one sampled fine-tuning row. + /// + public sealed partial class FineTunePreviewRow + { + /// + /// Token IDs produced for the sampled row. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_ids")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList InputIds { get; set; } + + /// + /// Raw token strings produced for the sampled row. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Tokens { get; set; } + + /// + /// Training labels for each token; masked tokens use -100. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("labels")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Labels { get; set; } + + /// + /// Half-open token index ranges that contribute to training loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trained_spans")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList> TrainedSpans { get; set; } + + /// + /// Total number of tokens in the preview row after truncation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumTokens { get; set; } + + /// + /// Number of tokens in the row that contribute to training loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_trained_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumTrainedTokens { get; set; } + + /// + /// Whether the row was truncated to the model maximum sequence length. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("truncated")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Truncated { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Token IDs produced for the sampled row. + /// + /// + /// Raw token strings produced for the sampled row. + /// + /// + /// Training labels for each token; masked tokens use -100. + /// + /// + /// Half-open token index ranges that contribute to training loss. + /// + /// + /// Total number of tokens in the preview row after truncation. + /// + /// + /// Number of tokens in the row that contribute to training loss. + /// + /// + /// Whether the row was truncated to the model maximum sequence length. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FineTunePreviewRow( + global::System.Collections.Generic.IList inputIds, + global::System.Collections.Generic.IList tokens, + global::System.Collections.Generic.IList labels, + global::System.Collections.Generic.IList> trainedSpans, + int numTokens, + int numTrainedTokens, + bool truncated) + { + this.InputIds = inputIds ?? throw new global::System.ArgumentNullException(nameof(inputIds)); + this.Tokens = tokens ?? throw new global::System.ArgumentNullException(nameof(tokens)); + this.Labels = labels ?? throw new global::System.ArgumentNullException(nameof(labels)); + this.TrainedSpans = trainedSpans ?? throw new global::System.ArgumentNullException(nameof(trainedSpans)); + this.NumTokens = numTokens; + this.NumTrainedTokens = numTrainedTokens; + this.Truncated = truncated; + } + + /// + /// Initializes a new instance of the class. + /// + public FineTunePreviewRow() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FineTuneProgress.Json.g.cs b/src/libs/Together/Generated/Together.Models.FineTuneProgress.Json.g.cs index 8ff5fd08..cde80804 100644 --- a/src/libs/Together/Generated/Together.Models.FineTuneProgress.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FineTuneProgress.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FineTuneProgress; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FineTuneProgress? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FineTuneProgress; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.cs index 26295b08..6d2244cb 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneEventType.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneEventType.g.cs index 1864930e..20f5ea88 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneEventType.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneEventType.g.cs @@ -23,6 +23,10 @@ public enum FinetuneEventType /// /// /// + EarlyStopped, + /// + /// + /// EpochComplete, /// /// @@ -125,6 +129,7 @@ public static string ToValueString(this FinetuneEventType value) FinetuneEventType.BillingLimit => "billing_limit", FinetuneEventType.CancelRequested => "cancel_requested", FinetuneEventType.CheckpointSave => "checkpoint_save", + FinetuneEventType.EarlyStopped => "early_stopped", FinetuneEventType.EpochComplete => "epoch_complete", FinetuneEventType.JobComplete => "job_complete", FinetuneEventType.JobError => "job_error", @@ -160,6 +165,7 @@ public static string ToValueString(this FinetuneEventType value) "billing_limit" => FinetuneEventType.BillingLimit, "cancel_requested" => FinetuneEventType.CancelRequested, "checkpoint_save" => FinetuneEventType.CheckpointSave, + "early_stopped" => FinetuneEventType.EarlyStopped, "epoch_complete" => FinetuneEventType.EpochComplete, "job_complete" => FinetuneEventType.JobComplete, "job_error" => FinetuneEventType.JobError, diff --git a/src/libs/Together/Generated/Together.Models.FinetuneListCheckpoints.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneListCheckpoints.Json.g.cs index 79115359..f5cd7b5f 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneListCheckpoints.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneListCheckpoints.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneListCheckpoints; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneListCheckpoints? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneListCheckpoints; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneListEvents.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneListEvents.Json.g.cs index 49b064ff..bbaafb05 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneListEvents.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneListEvents.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneListEvents; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneListEvents? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneListEvents; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneResponse.Json.g.cs index 36e9ded2..9eebdc8b 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneResponse.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneResponse.g.cs index ecafb034..8e6611e5 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneResponse.g.cs @@ -45,6 +45,49 @@ public sealed partial class FinetuneResponse [global::System.Text.Json.Serialization.JsonPropertyName("model_output_path")] public string? ModelOutputPath { get; set; } + /// + /// Together model registry object ID for the final model weights (e.g. `ml_...`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_object_id")] + public string? ModelObjectId { get; set; } + + /// + /// Together model registry name for the final model weights, formatted as `<project_slug>/<model_name>`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_object_name")] + public string? ModelObjectName { get; set; } + + /// + /// Together model registry revision ID for the final model weights (e.g. `rv_...`). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_object_revision_id")] + public string? ModelObjectRevisionId { get; set; } + + /// + /// Together model registry object ID for the final adapter weights on LoRA jobs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_object_id")] + public string? AdapterObjectId { get; set; } + + /// + /// Together model registry name for the final adapter weights on LoRA jobs, formatted as `<project_slug>/<model_name>-adapter`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_object_name")] + public string? AdapterObjectName { get; set; } + + /// + /// Together model registry revision ID for the final adapter weights on LoRA jobs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_object_revision_id")] + public string? AdapterObjectRevisionId { get; set; } + + /// + /// ID of the user who created the fine-tune job. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UserId { get; set; } + /// /// /// @@ -122,13 +165,13 @@ public sealed partial class FinetuneResponse /// /// [global::System.Text.Json.Serialization.JsonPropertyName("max_grad_norm")] - public float? MaxGradNorm { get; set; } + public double? MaxGradNorm { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("weight_decay")] - public float? WeightDecay { get; set; } + public double? WeightDecay { get; set; } /// /// @@ -249,6 +292,24 @@ public sealed partial class FinetuneResponse [global::System.Text.Json.Serialization.JsonPropertyName("progress")] public global::Together.FineTuneProgress? Progress { get; set; } + /// + /// Whether the early-stopping criterion triggered. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopped")] + public bool? EarlyStopped { get; set; } + + /// + /// Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_step")] + public int? EarlyStoppingBestStep { get; set; } + + /// + /// Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded (for example, a non-finite first evaluation). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_metric")] + public double? EarlyStoppingBestMetric { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -259,12 +320,33 @@ public sealed partial class FinetuneResponse /// Initializes a new instance of the class. /// /// + /// + /// ID of the user who created the fine-tune job. + /// /// /// /// /// /// /// + /// + /// Together model registry object ID for the final model weights (e.g. `ml_...`). + /// + /// + /// Together model registry name for the final model weights, formatted as `<project_slug>/<model_name>`. + /// + /// + /// Together model registry revision ID for the final model weights (e.g. `rv_...`). + /// + /// + /// Together model registry object ID for the final adapter weights on LoRA jobs. + /// + /// + /// Together model registry name for the final adapter weights on LoRA jobs, formatted as `<project_slug>/<model_name>-adapter`. + /// + /// + /// Together model registry revision ID for the final adapter weights on LoRA jobs. + /// /// /// /// @@ -303,17 +385,33 @@ public sealed partial class FinetuneResponse /// /// Progress information for a fine-tuning job /// + /// + /// Whether the early-stopping criterion triggered. + /// + /// + /// Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + /// + /// + /// Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded (for example, a non-finite first evaluation). + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public FinetuneResponse( global::System.Guid id, + string userId, global::Together.FinetuneJobStatus status, string? trainingFile, string? validationFile, string? model, string? modelOutputName, string? modelOutputPath, + string? modelObjectId, + string? modelObjectName, + string? modelObjectRevisionId, + string? adapterObjectId, + string? adapterObjectName, + string? adapterObjectRevisionId, int? trainingfileNumlines, int? trainingfileSize, global::System.DateTime? createdAt, @@ -326,8 +424,8 @@ public FinetuneResponse( double? learningRate, global::Together.LRScheduler? lrScheduler, double? warmupRatio, - float? maxGradNorm, - float? weightDecay, + double? maxGradNorm, + double? weightDecay, int? evalSteps, global::Together.OneOf? trainOnInputs, global::Together.OneOf? trainingMethod, @@ -345,7 +443,10 @@ public FinetuneResponse( string? fromCheckpoint, string? fromHfModel, string? hfModelRevision, - global::Together.FineTuneProgress? progress) + global::Together.FineTuneProgress? progress, + bool? earlyStopped, + int? earlyStoppingBestStep, + double? earlyStoppingBestMetric) { this.Id = id; this.TrainingFile = trainingFile; @@ -353,6 +454,13 @@ public FinetuneResponse( this.Model = model; this.ModelOutputName = modelOutputName; this.ModelOutputPath = modelOutputPath; + this.ModelObjectId = modelObjectId; + this.ModelObjectName = modelObjectName; + this.ModelObjectRevisionId = modelObjectRevisionId; + this.AdapterObjectId = adapterObjectId; + this.AdapterObjectName = adapterObjectName; + this.AdapterObjectRevisionId = adapterObjectRevisionId; + this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); this.TrainingfileNumlines = trainingfileNumlines; this.TrainingfileSize = trainingfileSize; this.CreatedAt = createdAt; @@ -386,6 +494,9 @@ public FinetuneResponse( this.FromHfModel = fromHfModel; this.HfModelRevision = hfModelRevision; this.Progress = progress; + this.EarlyStopped = earlyStopped; + this.EarlyStoppingBestStep = earlyStoppingBestStep; + this.EarlyStoppingBestMetric = earlyStoppingBestMetric; } /// diff --git a/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.Json.g.cs index 719da018..4aedd151 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneResponseTruncated; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneResponseTruncated? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneResponseTruncated; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.g.cs index 38a96107..9057db22 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneResponseTruncated.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints
- /// Example: {"id":"ft-01234567890123456789","status":"completed","created_at":"2023-05-17T17:35:45.123Z","updated_at":"2023-05-17T18:46:23.456Z","user_id":"user_01234567890123456789","owner_address":"user@example.com","total_price":1500,"token_count":850000,"events":[],"model":"meta-llama/Llama-2-7b-hf","model_output_name":"mynamespace/meta-llama/Llama-2-7b-hf-32162631","n_epochs":3,"training_file":"file-01234567890123456789","wandb_project_name":"my-finetune-project"} + /// Example: {"id":"ft-01234567890123456789","status":"completed","created_at":"2023-05-17T17:35:45.123Z","updated_at":"2023-05-17T18:46:23.456Z","user_id":"user_789xyz012","owner_address":"user@example.com","total_price":1500,"token_count":850000,"events":[],"model":"meta-llama/Llama-2-7b-hf","model_output_name":"mynamespace/meta-llama/Llama-2-7b-hf-32162631","n_epochs":3,"training_file":"file-01234567890123456789","wandb_project_name":"my-finetune-project"} ///
public sealed partial class FinetuneResponseTruncated { @@ -45,10 +45,11 @@ public sealed partial class FinetuneResponseTruncated public global::System.DateTime? StartedAt { get; set; } /// - /// Identifier for who created the job. + /// ID of the user who created the fine-tune job. /// [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] - public string? UserId { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required string UserId { get; set; } /// /// Owner address information @@ -158,7 +159,7 @@ public sealed partial class FinetuneResponseTruncated /// Learning rate used for training /// [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public float? LearningRate { get; set; } + public double? LearningRate { get; set; } /// /// Learning rate scheduler configuration @@ -170,19 +171,19 @@ public sealed partial class FinetuneResponseTruncated /// Ratio of warmup steps /// [global::System.Text.Json.Serialization.JsonPropertyName("warmup_ratio")] - public float? WarmupRatio { get; set; } + public double? WarmupRatio { get; set; } /// /// Maximum gradient norm for clipping /// [global::System.Text.Json.Serialization.JsonPropertyName("max_grad_norm")] - public float? MaxGradNorm { get; set; } + public double? MaxGradNorm { get; set; } /// /// Weight decay value used /// [global::System.Text.Json.Serialization.JsonPropertyName("weight_decay")] - public float? WeightDecay { get; set; } + public double? WeightDecay { get; set; } /// /// Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded. @@ -226,6 +227,24 @@ public sealed partial class FinetuneResponseTruncated [global::System.Text.Json.Serialization.JsonPropertyName("progress")] public global::Together.FineTuneProgress? Progress { get; set; } + /// + /// Whether the early-stopping criterion triggered. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopped")] + public bool? EarlyStopped { get; set; } + + /// + /// Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_step")] + public int? EarlyStoppingBestStep { get; set; } + + /// + /// Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("early_stopping_best_metric")] + public double? EarlyStoppingBestMetric { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -245,12 +264,12 @@ public sealed partial class FinetuneResponseTruncated /// /// Last update timestamp of the fine-tune job /// + /// + /// ID of the user who created the fine-tune job. + /// /// /// Start timestamp of the current stage of the fine-tune job /// - /// - /// Identifier for who created the job. - /// /// /// Owner address information /// @@ -336,6 +355,15 @@ public sealed partial class FinetuneResponseTruncated /// /// Progress information for the fine-tuning job /// + /// + /// Whether the early-stopping criterion triggered. + /// + /// + /// Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + /// + /// + /// Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -344,8 +372,8 @@ public FinetuneResponseTruncated( global::Together.FinetuneJobStatus status, global::System.DateTime createdAt, global::System.DateTime updatedAt, + string userId, global::System.DateTime? startedAt, - string? userId, string? ownerAddress, int? totalPrice, int? tokenCount, @@ -363,25 +391,28 @@ public FinetuneResponseTruncated( int? batchSize, global::Together.OneOf? trainingType, global::Together.OneOf? trainingMethod, - float? learningRate, + double? learningRate, global::Together.LRScheduler? lrScheduler, - float? warmupRatio, - float? maxGradNorm, - float? weightDecay, + double? warmupRatio, + double? maxGradNorm, + double? weightDecay, int? randomSeed, string? wandbProjectName, string? wandbName, string? fromCheckpoint, string? fromHfModel, string? hfModelRevision, - global::Together.FineTuneProgress? progress) + global::Together.FineTuneProgress? progress, + bool? earlyStopped, + int? earlyStoppingBestStep, + double? earlyStoppingBestMetric) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Status = status; this.CreatedAt = createdAt; this.UpdatedAt = updatedAt; this.StartedAt = startedAt; - this.UserId = userId; + this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); this.OwnerAddress = ownerAddress; this.TotalPrice = totalPrice; this.TokenCount = tokenCount; @@ -411,6 +442,9 @@ public FinetuneResponseTruncated( this.FromHfModel = fromHfModel; this.HfModelRevision = hfModelRevision; this.Progress = progress; + this.EarlyStopped = earlyStopped; + this.EarlyStoppingBestStep = earlyStoppingBestStep; + this.EarlyStoppingBestMetric = earlyStoppingBestMetric; } /// diff --git a/src/libs/Together/Generated/Together.Models.FinetuneTruncatedList.Json.g.cs b/src/libs/Together/Generated/Together.Models.FinetuneTruncatedList.Json.g.cs index 2598cb2c..a5c0af58 100644 --- a/src/libs/Together/Generated/Together.Models.FinetuneTruncatedList.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FinetuneTruncatedList.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FinetuneTruncatedList; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FinetuneTruncatedList? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FinetuneTruncatedList; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.FullTrainingType.Json.g.cs b/src/libs/Together/Generated/Together.Models.FullTrainingType.Json.g.cs index 7c9082eb..d7af9e5a 100644 --- a/src/libs/Together/Generated/Together.Models.FullTrainingType.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.FullTrainingType.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.FullTrainingType; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.FullTrainingType? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.FullTrainingType; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.Json.g.cs index a4a9009a..6b657cff 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterControlPlaneNode; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterControlPlaneNode? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterControlPlaneNode; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.g.cs index bafe0854..81202a85 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterControlPlaneNode.g.cs @@ -15,13 +15,6 @@ public sealed partial class GPUClusterControlPlaneNode [global::System.Text.Json.Serialization.JsonRequired] public required string NodeId { get; set; } - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("node_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string NodeName { get; set; } - /// /// /// @@ -48,7 +41,7 @@ public sealed partial class GPUClusterControlPlaneNode /// [global::System.Text.Json.Serialization.JsonPropertyName("memory_gib")] [global::System.Text.Json.Serialization.JsonRequired] - public required float MemoryGib { get; set; } + public required double MemoryGib { get; set; } /// /// @@ -64,6 +57,12 @@ public sealed partial class GPUClusterControlPlaneNode [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList PhaseTransitions { get; set; } + /// + /// Public IPv4 address of the control plane node. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("public_ipv4")] + public string? PublicIpv4 { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -74,7 +73,6 @@ public sealed partial class GPUClusterControlPlaneNode /// Initializes a new instance of the class. /// /// - /// /// /// /// @@ -83,27 +81,30 @@ public sealed partial class GPUClusterControlPlaneNode /// /// Phase transition history for this control plane node. /// + /// + /// Public IPv4 address of the control plane node. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GPUClusterControlPlaneNode( string nodeId, - string nodeName, string status, string hostName, int numCpuCores, - float memoryGib, + double memoryGib, string network, - global::System.Collections.Generic.IList phaseTransitions) + global::System.Collections.Generic.IList phaseTransitions, + string? publicIpv4) { this.NodeId = nodeId ?? throw new global::System.ArgumentNullException(nameof(nodeId)); - this.NodeName = nodeName ?? throw new global::System.ArgumentNullException(nameof(nodeName)); this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); this.HostName = hostName ?? throw new global::System.ArgumentNullException(nameof(hostName)); this.NumCpuCores = numCpuCores; this.MemoryGib = memoryGib; this.Network = network ?? throw new global::System.ArgumentNullException(nameof(network)); this.PhaseTransitions = phaseTransitions ?? throw new global::System.ArgumentNullException(nameof(phaseTransitions)); + this.PublicIpv4 = publicIpv4; } /// diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.Json.g.cs index 9be0629f..a138e0fd 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterCreateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterCreateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.g.cs index cd8caef8..d424e781 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequest.g.cs @@ -74,13 +74,6 @@ public sealed partial class GPUClusterCreateRequest [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.GPUClusterCreateRequestBillingType BillingType { get; set; } - /// - /// Whether automated GPU node failover should be enabled for this cluster. By default, it is disabled.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("gpu_node_failover_enabled")] - public bool? GpuNodeFailoverEnabled { get; set; } - /// /// Whether GPU cluster should be auto-scaled based on the workload. By default, it is not auto-scaled.
/// Default Value: false @@ -244,10 +237,6 @@ public sealed partial class GPUClusterCreateRequest /// /// ID of an existing volume to use with the cluster creation. /// - /// - /// Whether automated GPU node failover should be enabled for this cluster. By default, it is disabled.
- /// Default Value: false - /// /// /// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. /// @@ -308,7 +297,6 @@ public GPUClusterCreateRequest( int? durationDays, global::Together.GPUClustersSharedVolumeCreateRequest? sharedVolume, string? volumeId, - bool? gpuNodeFailoverEnabled, int? autoScaleMaxGpus, int? slurmShmSizeGib, string? capacityPoolId, @@ -335,7 +323,6 @@ public GPUClusterCreateRequest( this.SharedVolume = sharedVolume; this.VolumeId = volumeId; this.BillingType = billingType; - this.GpuNodeFailoverEnabled = gpuNodeFailoverEnabled; this.AutoScaleMaxGpus = autoScaleMaxGpus; this.SlurmShmSizeGib = slurmShmSizeGib; this.CapacityPoolId = capacityPoolId; diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterDeleteResponse.Json.g.cs index 64eb4aba..830964d0 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterDeleteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.Json.g.cs index 258cf09a..9d8fd5d7 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterGPUWorkerNode; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterGPUWorkerNode? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterGPUWorkerNode; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.g.cs index 48f22da9..72f988d9 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterGPUWorkerNode.g.cs @@ -15,13 +15,6 @@ public sealed partial class GPUClusterGPUWorkerNode [global::System.Text.Json.Serialization.JsonRequired] public required string NodeId { get; set; } - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("node_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string NodeName { get; set; } - /// /// /// @@ -55,7 +48,7 @@ public sealed partial class GPUClusterGPUWorkerNode ///
[global::System.Text.Json.Serialization.JsonPropertyName("memory_gib")] [global::System.Text.Json.Serialization.JsonRequired] - public required float MemoryGib { get; set; } + public required double MemoryGib { get; set; } /// /// @@ -90,6 +83,60 @@ public sealed partial class GPUClusterGPUWorkerNode [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList PhaseTransitions { get; set; } + /// + /// Whether this node is marked for deletion by the operator. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("marked_for_deletion")] + public bool? MarkedForDeletion { get; set; } + + /// + /// Public IPv4 address of the GPU worker node. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("public_ipv4")] + public string? PublicIpv4 { get; set; } + + /// + /// InfiniBand HCA type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ib_hca_type")] + public string? IbHcaType { get; set; } + + /// + /// Number of InfiniBand HCAs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ib_hca_count")] + public int? IbHcaCount { get; set; } + + /// + /// Number of NVSwitches. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nvswitch_count")] + public int? NvswitchCount { get; set; } + + /// + /// NVSwitch type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nvswitch_type")] + public string? NvswitchType { get; set; } + + /// + /// Ephemeral storage size, such as 1Ti. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ephemeral_storage")] + public string? EphemeralStorage { get; set; } + + /// + /// Whether auto-remediation is enabled for this node's instance. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("auto_remediation_enabled")] + public bool? AutoRemediationEnabled { get; set; } + + /// + /// Timestamp when the node left the live data plane. Only set for deleted_gpu_worker_nodes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deleted_at")] + public global::System.DateTime? DeletedAt { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -100,7 +147,6 @@ public sealed partial class GPUClusterGPUWorkerNode /// Initializes a new instance of the class. /// /// - /// /// /// /// @@ -116,25 +162,59 @@ public sealed partial class GPUClusterGPUWorkerNode /// An instance can have multiple remediations over time (e.g., failed attempts followed by retries). /// /// + /// + /// Whether this node is marked for deletion by the operator. + /// + /// + /// Public IPv4 address of the GPU worker node. + /// + /// + /// InfiniBand HCA type. + /// + /// + /// Number of InfiniBand HCAs. + /// + /// + /// Number of NVSwitches. + /// + /// + /// NVSwitch type. + /// + /// + /// Ephemeral storage size, such as 1Ti. + /// + /// + /// Whether auto-remediation is enabled for this node's instance. + /// + /// + /// Timestamp when the node left the live data plane. Only set for deleted_gpu_worker_nodes. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GPUClusterGPUWorkerNode( string nodeId, - string nodeName, string status, string hostName, int numCpuCores, int numGpus, - float memoryGib, + double memoryGib, global::System.Collections.Generic.IList networks, global::System.Collections.Generic.IList phaseTransitions, string? instanceId, global::Together.Remediation? latestRemediation, - string? slurmWorkerHostname) + string? slurmWorkerHostname, + bool? markedForDeletion, + string? publicIpv4, + string? ibHcaType, + int? ibHcaCount, + int? nvswitchCount, + string? nvswitchType, + string? ephemeralStorage, + bool? autoRemediationEnabled, + global::System.DateTime? deletedAt) { this.NodeId = nodeId ?? throw new global::System.ArgumentNullException(nameof(nodeId)); - this.NodeName = nodeName ?? throw new global::System.ArgumentNullException(nameof(nodeName)); this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); this.HostName = hostName ?? throw new global::System.ArgumentNullException(nameof(hostName)); this.NumCpuCores = numCpuCores; @@ -145,6 +225,15 @@ public GPUClusterGPUWorkerNode( this.LatestRemediation = latestRemediation; this.SlurmWorkerHostname = slurmWorkerHostname; this.PhaseTransitions = phaseTransitions ?? throw new global::System.ArgumentNullException(nameof(phaseTransitions)); + this.MarkedForDeletion = markedForDeletion; + this.PublicIpv4 = publicIpv4; + this.IbHcaType = ibHcaType; + this.IbHcaCount = ibHcaCount; + this.NvswitchCount = nvswitchCount; + this.NvswitchType = nvswitchType; + this.EphemeralStorage = ephemeralStorage; + this.AutoRemediationEnabled = autoRemediationEnabled; + this.DeletedAt = deletedAt; } /// diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.Json.g.cs index 5c70f357..396358d0 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs index f8939b19..55572322 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs @@ -206,6 +206,80 @@ public sealed partial class GPUClusterInfo [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList AddOns { get; set; } + /// + /// ID of the machine cluster backing this GPU cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("machine_cluster_id")] + public string? MachineClusterId { get; set; } + + /// + /// Timestamp when the cluster first reached the Ready phase. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("first_ready_at")] + public global::System.DateTime? FirstReadyAt { get; set; } + + /// + /// Whether the cluster is managed inside a substrate environment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_in_substrate")] + public bool? IsInSubstrate { get; set; } + + /// + /// Whether the control plane is currently ready. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("control_plane_ready")] + public bool? ControlPlaneReady { get; set; } + + /// + /// UMS project ID associated with this cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ums_project_id")] + public string? UmsProjectId { get; set; } + + /// + /// UMS organization ID associated with this cluster. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ums_org_id")] + public string? UmsOrgId { get; set; } + + /// + /// Data-volume image name for GPU worker nodes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("os_image")] + public string? OsImage { get; set; } + + /// + /// Internal NVIDIA version ID for this cluster's driver and CUDA combination. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nvidia_driver_version_id")] + public string? NvidiaDriverVersionId { get; set; } + + /// + /// Number of GPUs to draw from a capacity pool. A component of the overall num_gpus, alongside num_reserved_gpus. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_capacity_pool_gpus")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumCapacityPoolGpus { get; set; } + + /// + /// Number of prepaid reserved GPUs for this cluster. A component of the overall num_gpus, alongside num_capacity_pool_gpus. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_reserved_gpus")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumReservedGpus { get; set; } + + /// + /// GPU worker nodes retained after they left the live data plane. These are separate from gpu_worker_nodes and must not be counted as live capacity. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deleted_gpu_worker_nodes")] + public global::System.Collections.Generic.IList? DeletedGpuWorkerNodes { get; set; } + + /// + /// Recent node lifecycle events such as scale-up, scale-down, and preemption. Combine these with live and deleted node lists to render the cluster timeline. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("node_lifecycle_events")] + public global::System.Collections.Generic.IList? NodeLifecycleEvents { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -251,6 +325,12 @@ public sealed partial class GPUClusterInfo /// /// Enabled add-ons on this cluster. Only add-ons with enabled=true in their config are returned. /// + /// + /// Number of GPUs to draw from a capacity pool. A component of the overall num_gpus, alongside num_reserved_gpus. + /// + /// + /// Number of prepaid reserved GPUs for this cluster. A component of the overall num_gpus, alongside num_capacity_pool_gpus. + /// /// /// /// @@ -260,6 +340,36 @@ public sealed partial class GPUClusterInfo /// /// /// + /// + /// ID of the machine cluster backing this GPU cluster. + /// + /// + /// Timestamp when the cluster first reached the Ready phase. + /// + /// + /// Whether the cluster is managed inside a substrate environment. + /// + /// + /// Whether the control plane is currently ready. + /// + /// + /// UMS project ID associated with this cluster. + /// + /// + /// UMS organization ID associated with this cluster. + /// + /// + /// Data-volume image name for GPU worker nodes. + /// + /// + /// Internal NVIDIA version ID for this cluster's driver and CUDA combination. + /// + /// + /// GPU worker nodes retained after they left the live data plane. These are separate from gpu_worker_nodes and must not be counted as live capacity. + /// + /// + /// Recent node lifecycle events such as scale-up, scale-down, and preemption. Combine these with live and deleted node lists to render the cluster timeline. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -284,6 +394,8 @@ public GPUClusterInfo( int allocatedPreemptibleGpus, global::Together.GPUClusterInfoBillingType billingType, global::System.Collections.Generic.IList addOns, + int numCapacityPoolGpus, + int numReservedGpus, int? durationHours, int? slurmShmSizeGib, string? capacityPoolId, @@ -292,7 +404,17 @@ public GPUClusterInfo( bool? installTraefik, global::System.DateTime? createdAt, global::Together.OIDCConfig? oidcConfig, - global::Together.InstanceClusterConfig? clusterConfig) + global::Together.InstanceClusterConfig? clusterConfig, + string? machineClusterId, + global::System.DateTime? firstReadyAt, + bool? isInSubstrate, + bool? controlPlaneReady, + string? umsProjectId, + string? umsOrgId, + string? osImage, + string? nvidiaDriverVersionId, + global::System.Collections.Generic.IList? deletedGpuWorkerNodes, + global::System.Collections.Generic.IList? nodeLifecycleEvents) { this.ClusterId = clusterId ?? throw new global::System.ArgumentNullException(nameof(clusterId)); this.ClusterType = clusterType; @@ -323,6 +445,18 @@ public GPUClusterInfo( this.AllocatedPreemptibleGpus = allocatedPreemptibleGpus; this.BillingType = billingType; this.AddOns = addOns ?? throw new global::System.ArgumentNullException(nameof(addOns)); + this.MachineClusterId = machineClusterId; + this.FirstReadyAt = firstReadyAt; + this.IsInSubstrate = isInSubstrate; + this.ControlPlaneReady = controlPlaneReady; + this.UmsProjectId = umsProjectId; + this.UmsOrgId = umsOrgId; + this.OsImage = osImage; + this.NvidiaDriverVersionId = nvidiaDriverVersionId; + this.NumCapacityPoolGpus = numCapacityPoolGpus; + this.NumReservedGpus = numReservedGpus; + this.DeletedGpuWorkerNodes = deletedGpuWorkerNodes; + this.NodeLifecycleEvents = nodeLifecycleEvents; } /// diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.Json.g.cs new file mode 100644 index 00000000..d8bb6158 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class GPUClusterNodeLifecycleEvent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.GPUClusterNodeLifecycleEvent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.GPUClusterNodeLifecycleEvent), + jsonSerializerContext) as global::Together.GPUClusterNodeLifecycleEvent; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterNodeLifecycleEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.GPUClusterNodeLifecycleEvent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.GPUClusterNodeLifecycleEvent), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterNodeLifecycleEvent; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.g.cs new file mode 100644 index 00000000..f5587e95 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.GPUClusterNodeLifecycleEvent.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace Together +{ + /// + /// Node lifecycle event included in a GPU cluster timeline. + /// + public sealed partial class GPUClusterNodeLifecycleEvent + { + /// + /// Tenant node name this lifecycle event applies to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("node_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string NodeId { get; set; } + + /// + /// Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or TogetherPreempted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Reason { get; set; } + + /// + /// Human-readable lifecycle event message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Event timestamp. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime Timestamp { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Tenant node name this lifecycle event applies to. + /// + /// + /// Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or TogetherPreempted. + /// + /// + /// Human-readable lifecycle event message. + /// + /// + /// Event timestamp. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GPUClusterNodeLifecycleEvent( + string nodeId, + string reason, + string message, + global::System.DateTime timestamp) + { + this.NodeId = nodeId ?? throw new global::System.ArgumentNullException(nameof(nodeId)); + this.Reason = reason ?? throw new global::System.ArgumentNullException(nameof(reason)); + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Timestamp = timestamp; + } + + /// + /// Initializes a new instance of the class. + /// + public GPUClusterNodeLifecycleEvent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.Json.g.cs index 5cc3037c..d7207e57 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterUpdateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterUpdateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.g.cs index 27a7db76..a5e0c32d 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterUpdateRequest.g.cs @@ -45,6 +45,12 @@ public sealed partial class GPUClusterUpdateRequest [global::System.Text.Json.Serialization.JsonPropertyName("num_preemptible_gpus")] public int? NumPreemptibleGpus { get; set; } + /// + /// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_capacity_pool_gpus")] + public int? NumCapacityPoolGpus { get; set; } + /// /// Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge. /// @@ -76,6 +82,9 @@ public sealed partial class GPUClusterUpdateRequest /// /// Updated desired number of preemptible GPUs for the cluster. When omitted, the current value is preserved. Must be a multiple of 8. /// + /// + /// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved. + /// /// /// Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge. /// @@ -89,6 +98,7 @@ public GPUClusterUpdateRequest( global::Together.InstanceClusterConfig? clusterConfig, int? numReservedGpus, int? numPreemptibleGpus, + int? numCapacityPoolGpus, global::System.Collections.Generic.IList? addOns) { this.ClusterType = clusterType; @@ -97,6 +107,7 @@ public GPUClusterUpdateRequest( this.ClusterConfig = clusterConfig; this.NumReservedGpus = numReservedGpus; this.NumPreemptibleGpus = numPreemptibleGpus; + this.NumCapacityPoolGpus = numCapacityPoolGpus; this.AddOns = addOns; } diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterVolume.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterVolume.Json.g.cs index 6e19a42d..4856d277 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterVolume.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterVolume.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusterVolume; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusterVolume? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusterVolume; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClusters.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusters.Json.g.cs index 06d741fa..e07b04a0 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClusters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClusters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClusters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolume.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolume.Json.g.cs index 413fa0a2..ef59e4f0 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolume.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolume.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClustersSharedVolume; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClustersSharedVolume? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClustersSharedVolume; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.Json.g.cs index d5c1ce14..0a2b51a4 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClustersSharedVolumeCreateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClustersSharedVolumeCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClustersSharedVolumeCreateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs index b57b57a8..e3c39e38 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs @@ -35,6 +35,12 @@ public sealed partial class GPUClustersSharedVolumeCreateRequest [global::System.Text.Json.Serialization.JsonPropertyName("is_lifecycle_independent")] public bool? IsLifecycleIndependent { get; set; } + /// + /// Project ID that will own the volume. When omitted, the caller's default project is used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + public string? ProjectId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -56,6 +62,9 @@ public sealed partial class GPUClustersSharedVolumeCreateRequest /// /// When true, the shared volume is not deleted when the cluster is decommissioned. /// + /// + /// Project ID that will own the volume. When omitted, the caller's default project is used. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -63,12 +72,14 @@ public GPUClustersSharedVolumeCreateRequest( string volumeName, long sizeTib, string region, - bool? isLifecycleIndependent) + bool? isLifecycleIndependent, + string? projectId) { this.VolumeName = volumeName ?? throw new global::System.ArgumentNullException(nameof(volumeName)); this.SizeTib = sizeTib; this.Region = region ?? throw new global::System.ArgumentNullException(nameof(region)); this.IsLifecycleIndependent = isLifecycleIndependent; + this.ProjectId = projectId; } /// diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeDeleteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeDeleteResponse.Json.g.cs index f2f1b710..781fded4 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeDeleteResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClustersSharedVolumeDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClustersSharedVolumeDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClustersSharedVolumeDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeUpdateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeUpdateRequest.Json.g.cs index 3be43270..5e69a453 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeUpdateRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeUpdateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClustersSharedVolumeUpdateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClustersSharedVolumeUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClustersSharedVolumeUpdateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumes.Json.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumes.Json.g.cs index aa3c75d2..5b5a4461 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumes.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumes.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GPUClustersSharedVolumes; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GPUClustersSharedVolumes? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GPUClustersSharedVolumes; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse.Json.g.cs index de324cbc..8a352bd5 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsLogsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsLogsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsLogsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse2.Json.g.cs index b3514686..fbc6fc63 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsLogsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsLogsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsLogsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsLogsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse.Json.g.cs index f2fbd8f7..e2d218b6 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse2.Json.g.cs index caa3e959..7582625c 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse3.Json.g.cs index 061ed58b..d8a3d0f8 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse.Json.g.cs index 4e05ef7e..49c878b5 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsSecretsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse2.Json.g.cs index ce4da628..95e66ad6 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsSecretsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse3.Json.g.cs index 12408920..2ab1b2f4 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsSecretsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsSecretsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse.Json.g.cs index b6f55532..7e6c9063 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse2.Json.g.cs index 2f4670a7..40a58c51 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse3.Json.g.cs index 4771c0c4..18f2deec 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse.Json.g.cs index d6185fde..961f8435 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageUrlResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageUrlResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageUrlResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse2.Json.g.cs index de64ef76..2251d6ca 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageUrlResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageUrlResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageUrlResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse3.Json.g.cs index eb76c440..002fc496 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageUrlResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageUrlResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageUrlResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageUrlResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse.Json.g.cs index e3066109..b1441ecb 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageVolumesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse2.Json.g.cs index b86af6df..7c773a53 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageVolumesResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse3.Json.g.cs index b47344c7..c283ae60 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageVolumesResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse4.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse4.Json.g.cs index c1d6224e..f06dbd94 100644 --- a/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse4.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetDeploymentsStorageVolumesResponse4.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetDeploymentsStorageVolumesResponse4; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetDeploymentsStorageVolumesResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetDeploymentsStorageVolumesResponse4; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetEvaluationJobStatusAndResultsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetEvaluationJobStatusAndResultsResponse.Json.g.cs index eccf81fa..ea89cb21 100644 --- a/src/libs/Together/Generated/Together.Models.GetEvaluationJobStatusAndResultsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetEvaluationJobStatusAndResultsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetEvaluationJobStatusAndResultsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetEvaluationJobStatusAndResultsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetEvaluationJobStatusAndResultsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponse.Json.g.cs index 7550f861..0a6de1ed 100644 --- a/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetFineTunesMetricsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetFineTunesMetricsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetFineTunesMetricsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponseMetric.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponseMetric.Json.g.cs index 4396cd46..e572c9d5 100644 --- a/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponseMetric.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesMetricsResponseMetric.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetFineTunesMetricsResponseMetric; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetFineTunesMetricsResponseMetric? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetFineTunesMetricsResponseMetric; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsLimitsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsLimitsResponse.Json.g.cs index f32beb0e..cf78ca19 100644 --- a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsLimitsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsLimitsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetFineTunesModelsLimitsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetFineTunesModelsLimitsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetFineTunesModelsLimitsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.Json.g.cs index 17badd08..0f68739e 100644 --- a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetFineTunesModelsSupportedResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetFineTunesModelsSupportedResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetFineTunesModelsSupportedResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.g.cs index ca5fe25f..5b160f51 100644 --- a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponse.g.cs @@ -15,6 +15,13 @@ public sealed partial class GetFineTunesModelsSupportedResponse [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Models { get; set; } + /// + /// Supported models with parent model details. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("detailed_models")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList DetailedModels { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -27,13 +34,18 @@ public sealed partial class GetFineTunesModelsSupportedResponse /// /// List of supported model names. /// + /// + /// Supported models with parent model details. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public GetFineTunesModelsSupportedResponse( - global::System.Collections.Generic.IList models) + global::System.Collections.Generic.IList models, + global::System.Collections.Generic.IList detailedModels) { this.Models = models ?? throw new global::System.ArgumentNullException(nameof(models)); + this.DetailedModels = detailedModels ?? throw new global::System.ArgumentNullException(nameof(detailedModels)); } /// diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.Json.g.cs new file mode 100644 index 00000000..f85b1411 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class GetFineTunesModelsSupportedResponseDetailedModel + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.GetFineTunesModelsSupportedResponseDetailedModel? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.GetFineTunesModelsSupportedResponseDetailedModel), + jsonSerializerContext) as global::Together.GetFineTunesModelsSupportedResponseDetailedModel; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetFineTunesModelsSupportedResponseDetailedModel? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.GetFineTunesModelsSupportedResponseDetailedModel? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.GetFineTunesModelsSupportedResponseDetailedModel), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetFineTunesModelsSupportedResponseDetailedModel; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.g.cs b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.g.cs new file mode 100644 index 00000000..7330ac3d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.GetFineTunesModelsSupportedResponseDetailedModel.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class GetFineTunesModelsSupportedResponseDetailedModel + { + /// + /// Supported model name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Parent model used for fine-tuning. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parent_model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ParentModel { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Supported model name. + /// + /// + /// Parent model used for fine-tuning. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetFineTunesModelsSupportedResponseDetailedModel( + string name, + string parentModel) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.ParentModel = parentModel ?? throw new global::System.ArgumentNullException(nameof(parentModel)); + } + + /// + /// Initializes a new instance of the class. + /// + public GetFineTunesModelsSupportedResponseDetailedModel() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.GetModelListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.GetModelListResponse.Json.g.cs index 0b4e7f8f..7ac536b3 100644 --- a/src/libs/Together/Generated/Together.Models.GetModelListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.GetModelListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.GetModelListResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.GetModelListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.GetModelListResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HTTPAutoscalingConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.HTTPAutoscalingConfig.Json.g.cs index 96870040..546bec47 100644 --- a/src/libs/Together/Generated/Together.Models.HTTPAutoscalingConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.HTTPAutoscalingConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.HTTPAutoscalingConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HTTPAutoscalingConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.HTTPAutoscalingConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs index fb03c54b..e6b7f659 100644 --- a/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.HardwareAvailability; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareAvailability? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareAvailability; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs index 3a3dd497..ed41c236 100644 --- a/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.HardwareSpec; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareSpec? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareSpec; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs b/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs index 2d14071a..c061c14e 100644 --- a/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs +++ b/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs @@ -27,7 +27,7 @@ public sealed partial class HardwareSpec /// [global::System.Text.Json.Serialization.JsonPropertyName("gpu_memory")] [global::System.Text.Json.Serialization.JsonRequired] - public required float GpuMemory { get; set; } + public required double GpuMemory { get; set; } /// /// Number of GPUs in this configuration @@ -63,7 +63,7 @@ public sealed partial class HardwareSpec public HardwareSpec( string gpuType, string gpuLink, - float gpuMemory, + double gpuMemory, int gpuCount) { this.GpuType = gpuType ?? throw new global::System.ArgumentNullException(nameof(gpuType)); diff --git a/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs index 15c14dbc..efb55f6c 100644 --- a/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.HardwareWithStatus; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareWithStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareWithStatus; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs index 1502522f..9069bf38 100644 --- a/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.HardwareWithStatusObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareWithStatusObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareWithStatusObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.HeadlampConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.HeadlampConfig.Json.g.cs new file mode 100644 index 00000000..59e7d7bd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HeadlampConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HeadlampConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HeadlampConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HeadlampConfig), + jsonSerializerContext) as global::Together.HeadlampConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HeadlampConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HeadlampConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HeadlampConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HeadlampConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.HeadlampConfig.g.cs b/src/libs/Together/Generated/Together.Models.HeadlampConfig.g.cs new file mode 100644 index 00000000..d48cd944 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HeadlampConfig.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for the Headlamp Kubernetes dashboard cluster add-on. + /// + public sealed partial class HeadlampConfig + { + /// + /// Whether to enable the Headlamp Kubernetes dashboard add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether to enable the Headlamp Kubernetes dashboard add-on. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HeadlampConfig( + bool? enabled) + { + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public HeadlampConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HeadlampState.Json.g.cs b/src/libs/Together/Generated/Together.Models.HeadlampState.Json.g.cs new file mode 100644 index 00000000..0220627e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HeadlampState.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HeadlampState + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HeadlampState? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HeadlampState), + jsonSerializerContext) as global::Together.HeadlampState; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HeadlampState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HeadlampState? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HeadlampState), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HeadlampState; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.HeadlampState.g.cs b/src/libs/Together/Generated/Together.Models.HeadlampState.g.cs new file mode 100644 index 00000000..275b9988 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HeadlampState.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Runtime state for the Headlamp Kubernetes dashboard cluster add-on. + /// + public sealed partial class HeadlampState + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs b/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs new file mode 100644 index 00000000..65b73710 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem + { + /// + /// + /// + PhcSeverityCritical, + /// + /// + /// + PhcSeverityInfo, + /// + /// + /// + PhcSeverityWarning, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem value) + { + return value switch + { + HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityCritical => "PHC_SEVERITY_CRITICAL", + HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityInfo => "PHC_SEVERITY_INFO", + HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityWarning => "PHC_SEVERITY_WARNING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? ToEnum(string value) + { + return value switch + { + "PHC_SEVERITY_CRITICAL" => HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityCritical, + "PHC_SEVERITY_INFO" => HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityInfo, + "PHC_SEVERITY_WARNING" => HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem.PhcSeverityWarning, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs b/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs new file mode 100644 index 00000000..4e3bd592 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HealthCheckServiceListPassiveHealthCheckAlertsStatus.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Lifecycle filter. Omit to return firing alerts. + /// + public enum HealthCheckServiceListPassiveHealthCheckAlertsStatus + { + /// + /// + /// + PhcAlertStatusAll, + /// + /// + /// + PhcAlertStatusFiring, + /// + /// + /// + PhcAlertStatusResolved, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HealthCheckServiceListPassiveHealthCheckAlertsStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HealthCheckServiceListPassiveHealthCheckAlertsStatus value) + { + return value switch + { + HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusAll => "PHC_ALERT_STATUS_ALL", + HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusFiring => "PHC_ALERT_STATUS_FIRING", + HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusResolved => "PHC_ALERT_STATUS_RESOLVED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HealthCheckServiceListPassiveHealthCheckAlertsStatus? ToEnum(string value) + { + return value switch + { + "PHC_ALERT_STATUS_ALL" => HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusAll, + "PHC_ALERT_STATUS_FIRING" => HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusFiring, + "PHC_ALERT_STATUS_RESOLVED" => HealthCheckServiceListPassiveHealthCheckAlertsStatus.PhcAlertStatusResolved, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ImageResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ImageResponse.Json.g.cs index b87f0b79..cdefd2a2 100644 --- a/src/libs/Together/Generated/Together.Models.ImageResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ImageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ImageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ImageResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ImageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ImageResponseDataB64.Json.g.cs b/src/libs/Together/Generated/Together.Models.ImageResponseDataB64.Json.g.cs index a2edfaba..d7eb600e 100644 --- a/src/libs/Together/Generated/Together.Models.ImageResponseDataB64.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ImageResponseDataB64.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ImageResponseDataB64; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ImageResponseDataB64? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ImageResponseDataB64; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ImageResponseDataItemDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.ImageResponseDataItemDiscriminator.Json.g.cs index 2c1e4fad..98be60e9 100644 --- a/src/libs/Together/Generated/Together.Models.ImageResponseDataItemDiscriminator.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ImageResponseDataItemDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ImageResponseDataItemDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ImageResponseDataItemDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ImageResponseDataItemDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ImageResponseDataUrl.Json.g.cs b/src/libs/Together/Generated/Together.Models.ImageResponseDataUrl.Json.g.cs index 87c13f8e..efb9d9f5 100644 --- a/src/libs/Together/Generated/Together.Models.ImageResponseDataUrl.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ImageResponseDataUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ImageResponseDataUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ImageResponseDataUrl? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ImageResponseDataUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ImageResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ImageResponseObject.Json.g.cs index 5453270e..73677d8c 100644 --- a/src/libs/Together/Generated/Together.Models.ImageResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ImageResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ImageResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ImageResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ImageResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InferenceWarning.Json.g.cs b/src/libs/Together/Generated/Together.Models.InferenceWarning.Json.g.cs index d699c069..0a143b0a 100644 --- a/src/libs/Together/Generated/Together.Models.InferenceWarning.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InferenceWarning.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InferenceWarning; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InferenceWarning? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InferenceWarning; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.IngressConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.IngressConfig.Json.g.cs index f9b41c48..a4e8c615 100644 --- a/src/libs/Together/Generated/Together.Models.IngressConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.IngressConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.IngressConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.IngressConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.IngressConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.IngressState.Json.g.cs b/src/libs/Together/Generated/Together.Models.IngressState.Json.g.cs index 47ba6048..7376060b 100644 --- a/src/libs/Together/Generated/Together.Models.IngressState.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.IngressState.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.IngressState; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.IngressState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.IngressState; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.Json.g.cs index b137b323..13468ab3 100644 --- a/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InstanceClusterConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InstanceClusterConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InstanceClusterConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.g.cs b/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.g.cs index dec2a995..d9991624 100644 --- a/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.InstanceClusterConfig.g.cs @@ -52,6 +52,18 @@ public sealed partial class InstanceClusterConfig [global::System.Text.Json.Serialization.JsonPropertyName("gpu_operator_version")] public string? GpuOperatorVersion { get; set; } + /// + /// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0). When omitted, a service default is applied. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("network_operator_version")] + public string? NetworkOperatorVersion { get; set; } + + /// + /// Whether this cluster uses a per-cluster SSH certificate authority for OIDC-signed SSH access. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ssh_ca_enabled")] + public bool? SshCaEnabled { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -72,6 +84,12 @@ public sealed partial class InstanceClusterConfig /// /// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When omitted, a service default is applied. /// + /// + /// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0). When omitted, a service default is applied. + /// + /// + /// Whether this cluster uses a per-cluster SSH certificate authority for OIDC-signed SSH access. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -82,7 +100,9 @@ public InstanceClusterConfig( global::Together.SlurmStartupScripts? slurmStartupScripts, global::Together.ClusterIngressConfig? ingress, global::Together.ObservabilityConfig? observability, - string? gpuOperatorVersion) + string? gpuOperatorVersion, + string? networkOperatorVersion, + bool? sshCaEnabled) { this.LoadBalancer = loadBalancer; this.KubernetesDashboardEnabled = kubernetesDashboardEnabled; @@ -91,6 +111,8 @@ public InstanceClusterConfig( this.Ingress = ingress; this.Observability = observability; this.GpuOperatorVersion = gpuOperatorVersion; + this.NetworkOperatorVersion = networkOperatorVersion; + this.SshCaEnabled = sshCaEnabled; } /// diff --git a/src/libs/Together/Generated/Together.Models.InstanceTypesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.InstanceTypesResponse.Json.g.cs index b3a11470..f9b0174e 100644 --- a/src/libs/Together/Generated/Together.Models.InstanceTypesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InstanceTypesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InstanceTypesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InstanceTypesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InstanceTypesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs index c540b9b1..fdc3b258 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutput?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutput?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs index ead68589..1d89e4fd 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs index 256e5dda..25b9f498 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs index 467ad078..f11f147b 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs index ef32aff2..ae93fee0 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs index ddbbdd93..0ba0ac17 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs index c4e75c71..ff4bec98 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs index 3511fb13..2fe44486 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs index 97b4257e..e63b5fbc 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputErrorOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputErrorOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputErrorOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs index bd289d23..ef7390b2 100644 --- a/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.InterpreterOutputStreamOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputStreamOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputStreamOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs index 18504092..1d25fec0 100644 --- a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.JobInfoSuccessResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs index d0d09a4f..54bdb627 100644 --- a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.JobInfoSuccessResponseArgs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseArgs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponseArgs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs index 310c9270..82e44a13 100644 --- a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.JobInfoSuccessResponseStatusUpdate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseStatusUpdate? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponseStatusUpdate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs index b9e9d1b5..c0961450 100644 --- a/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.JobsInfoSuccessResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobsInfoSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobsInfoSuccessResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.KubernetesEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.KubernetesEvent.Json.g.cs index aff278f1..0c1b606d 100644 --- a/src/libs/Together/Generated/Together.Models.KubernetesEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.KubernetesEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.KubernetesEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.KubernetesEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.KubernetesEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.LRScheduler.Json.g.cs b/src/libs/Together/Generated/Together.Models.LRScheduler.Json.g.cs index 0d457191..f4e64a53 100644 --- a/src/libs/Together/Generated/Together.Models.LRScheduler.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.LRScheduler.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.LRScheduler; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.LRScheduler? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.LRScheduler; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.Json.g.cs b/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.Json.g.cs index 0812fb63..34f8d35e 100644 --- a/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.LinearLRSchedulerArgs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.LinearLRSchedulerArgs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.LinearLRSchedulerArgs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.g.cs b/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.g.cs index 65b47c67..08ea469c 100644 --- a/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.g.cs +++ b/src/libs/Together/Generated/Together.Models.LinearLRSchedulerArgs.g.cs @@ -10,10 +10,10 @@ public sealed partial class LinearLRSchedulerArgs { /// /// The ratio of the final learning rate to the peak learning rate
- /// Default Value: 0 + /// Default Value: 0.0 ///
[global::System.Text.Json.Serialization.JsonPropertyName("min_lr_ratio")] - public float? MinLrRatio { get; set; } + public double? MinLrRatio { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -26,13 +26,13 @@ public sealed partial class LinearLRSchedulerArgs /// /// /// The ratio of the final learning rate to the peak learning rate
- /// Default Value: 0 + /// Default Value: 0.0 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public LinearLRSchedulerArgs( - float? minLrRatio) + double? minLrRatio) { this.MinLrRatio = minLrRatio; } diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs new file mode 100644 index 00000000..8df4cdd9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListAdaptersResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListAdaptersResponse), + jsonSerializerContext) as global::Together.ListAdaptersResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListAdaptersResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListAdaptersResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAdaptersResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs new file mode 100644 index 00000000..456eda13 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ListAdaptersResponse + { + /// + /// Example: list + /// + /// list + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::System.Collections.Generic.IList? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: list + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAdaptersResponse( + string? @object, + global::System.Collections.Generic.IList? data) + { + this.Object = @object; + this.Data = data; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAdaptersResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs new file mode 100644 index 00000000..76bd22c4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListAdaptersResponseDataItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponseDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListAdaptersResponseDataItem), + jsonSerializerContext) as global::Together.ListAdaptersResponseDataItem; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponseDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListAdaptersResponseDataItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListAdaptersResponseDataItem), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAdaptersResponseDataItem; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs new file mode 100644 index 00000000..b17e49d0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ListAdaptersResponseDataItem + { + /// + /// Combined endpoint:adapter identifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_name")] + public string? AdapterName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpoint_name")] + public string? EndpointName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Combined endpoint:adapter identifier + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAdaptersResponseDataItem( + string? modelId, + string? adapterName, + string? endpointName) + { + this.ModelId = modelId; + this.AdapterName = adapterName; + this.EndpointName = endpointName; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAdaptersResponseDataItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs index ccda7fad..08fb3eaa 100644 --- a/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListAvailibilityZonesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAvailibilityZonesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAvailibilityZonesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs index c1d18e4f..c0f854fc 100644 --- a/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListEndpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs index 4b4afaf5..8bccbeac 100644 --- a/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListEndpointObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpointObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs index 4da90241..f4e1d5c0 100644 --- a/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListEndpointsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpointsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs index 25bdfe34..588ad6b9 100644 --- a/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListEndpointsResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpointsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointsResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs index 2e8a4de4..abcda90e 100644 --- a/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListHardwareResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListHardwareResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListHardwareResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs index 31d3f6c9..30503cc0 100644 --- a/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListHardwareResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListHardwareResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListHardwareResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListModelResourcesStatu.g.cs b/src/libs/Together/Generated/Together.Models.ListModelResourcesStatu.g.cs new file mode 100644 index 00000000..128d1926 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListModelResourcesStatu.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ListModelResourcesStatu + { + /// + /// + /// + ModelResourcesStatusCreating, + /// + /// + /// + ModelResourcesStatusError, + /// + /// + /// + ModelResourcesStatusPending, + /// + /// + /// + ModelResourcesStatusReady, + /// + /// + /// + ModelResourcesStatusStopped, + /// + /// + /// + ModelResourcesStatusStopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListModelResourcesStatuExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListModelResourcesStatu value) + { + return value switch + { + ListModelResourcesStatu.ModelResourcesStatusCreating => "MODEL_RESOURCES_STATUS_CREATING", + ListModelResourcesStatu.ModelResourcesStatusError => "MODEL_RESOURCES_STATUS_ERROR", + ListModelResourcesStatu.ModelResourcesStatusPending => "MODEL_RESOURCES_STATUS_PENDING", + ListModelResourcesStatu.ModelResourcesStatusReady => "MODEL_RESOURCES_STATUS_READY", + ListModelResourcesStatu.ModelResourcesStatusStopped => "MODEL_RESOURCES_STATUS_STOPPED", + ListModelResourcesStatu.ModelResourcesStatusStopping => "MODEL_RESOURCES_STATUS_STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListModelResourcesStatu? ToEnum(string value) + { + return value switch + { + "MODEL_RESOURCES_STATUS_CREATING" => ListModelResourcesStatu.ModelResourcesStatusCreating, + "MODEL_RESOURCES_STATUS_ERROR" => ListModelResourcesStatu.ModelResourcesStatusError, + "MODEL_RESOURCES_STATUS_PENDING" => ListModelResourcesStatu.ModelResourcesStatusPending, + "MODEL_RESOURCES_STATUS_READY" => ListModelResourcesStatu.ModelResourcesStatusReady, + "MODEL_RESOURCES_STATUS_STOPPED" => ListModelResourcesStatu.ModelResourcesStatusStopped, + "MODEL_RESOURCES_STATUS_STOPPING" => ListModelResourcesStatu.ModelResourcesStatusStopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.Json.g.cs new file mode 100644 index 00000000..317536c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListPassiveHealthCheckAlertsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListPassiveHealthCheckAlertsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListPassiveHealthCheckAlertsResponse), + jsonSerializerContext) as global::Together.ListPassiveHealthCheckAlertsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListPassiveHealthCheckAlertsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListPassiveHealthCheckAlertsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListPassiveHealthCheckAlertsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListPassiveHealthCheckAlertsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.g.cs new file mode 100644 index 00000000..78c9457d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListPassiveHealthCheckAlertsResponse.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Response returned when listing passive health check alerts. + /// + public sealed partial class ListPassiveHealthCheckAlertsResponse + { + /// + /// Alerts on the current page, ordered by start time descending. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("alerts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Alerts { get; set; } + + /// + /// Opaque token for the next page. Empty means there are no more pages. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_page_token")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string NextPageToken { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Alerts on the current page, ordered by start time descending. + /// + /// + /// Opaque token for the next page. Empty means there are no more pages. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListPassiveHealthCheckAlertsResponse( + global::System.Collections.Generic.IList alerts, + string nextPageToken) + { + this.Alerts = alerts ?? throw new global::System.ArgumentNullException(nameof(alerts)); + this.NextPageToken = nextPageToken ?? throw new global::System.ArgumentNullException(nameof(nextPageToken)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListPassiveHealthCheckAlertsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListRemediationsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListRemediationsResponse.Json.g.cs index d83af267..6de64eb3 100644 --- a/src/libs/Together/Generated/Together.Models.ListRemediationsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListRemediationsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListRemediationsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListRemediationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListRemediationsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListSecretsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListSecretsResponse.Json.g.cs index ab2f1679..d50aeda0 100644 --- a/src/libs/Together/Generated/Together.Models.ListSecretsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListSecretsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListSecretsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListSecretsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListSecretsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListSecretsResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListSecretsResponseObject.Json.g.cs index 618dcde2..c68d4c83 100644 --- a/src/libs/Together/Generated/Together.Models.ListSecretsResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListSecretsResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListSecretsResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListSecretsResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListSecretsResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListTrainingSessionsStatu.g.cs b/src/libs/Together/Generated/Together.Models.ListTrainingSessionsStatu.g.cs new file mode 100644 index 00000000..80e77c28 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListTrainingSessionsStatu.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ListTrainingSessionsStatu + { + /// + /// + /// + TrainingSessionStatusCreating, + /// + /// + /// + TrainingSessionStatusError, + /// + /// + /// + TrainingSessionStatusExpired, + /// + /// + /// + TrainingSessionStatusRunning, + /// + /// + /// + TrainingSessionStatusStopped, + /// + /// + /// + TrainingSessionStatusStopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListTrainingSessionsStatuExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListTrainingSessionsStatu value) + { + return value switch + { + ListTrainingSessionsStatu.TrainingSessionStatusCreating => "TRAINING_SESSION_STATUS_CREATING", + ListTrainingSessionsStatu.TrainingSessionStatusError => "TRAINING_SESSION_STATUS_ERROR", + ListTrainingSessionsStatu.TrainingSessionStatusExpired => "TRAINING_SESSION_STATUS_EXPIRED", + ListTrainingSessionsStatu.TrainingSessionStatusRunning => "TRAINING_SESSION_STATUS_RUNNING", + ListTrainingSessionsStatu.TrainingSessionStatusStopped => "TRAINING_SESSION_STATUS_STOPPED", + ListTrainingSessionsStatu.TrainingSessionStatusStopping => "TRAINING_SESSION_STATUS_STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListTrainingSessionsStatu? ToEnum(string value) + { + return value switch + { + "TRAINING_SESSION_STATUS_CREATING" => ListTrainingSessionsStatu.TrainingSessionStatusCreating, + "TRAINING_SESSION_STATUS_ERROR" => ListTrainingSessionsStatu.TrainingSessionStatusError, + "TRAINING_SESSION_STATUS_EXPIRED" => ListTrainingSessionsStatu.TrainingSessionStatusExpired, + "TRAINING_SESSION_STATUS_RUNNING" => ListTrainingSessionsStatu.TrainingSessionStatusRunning, + "TRAINING_SESSION_STATUS_STOPPED" => ListTrainingSessionsStatu.TrainingSessionStatusStopped, + "TRAINING_SESSION_STATUS_STOPPING" => ListTrainingSessionsStatu.TrainingSessionStatusStopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListVoicesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListVoicesResponse.Json.g.cs index 8e56ccd2..6288d0eb 100644 --- a/src/libs/Together/Generated/Together.Models.ListVoicesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListVoicesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListVoicesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListVoicesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListVoicesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListVolumesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListVolumesResponse.Json.g.cs index f3165b6c..4ee16733 100644 --- a/src/libs/Together/Generated/Together.Models.ListVolumesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListVolumesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListVolumesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListVolumesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListVolumesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ListVolumesResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListVolumesResponseObject.Json.g.cs index 7e9678d1..86f4ae14 100644 --- a/src/libs/Together/Generated/Together.Models.ListVolumesResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListVolumesResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ListVolumesResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListVolumesResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListVolumesResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.LoRATrainingType.Json.g.cs b/src/libs/Together/Generated/Together.Models.LoRATrainingType.Json.g.cs index 8b8e3ffd..1e314c18 100644 --- a/src/libs/Together/Generated/Together.Models.LoRATrainingType.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.LoRATrainingType.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.LoRATrainingType; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.LoRATrainingType? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.LoRATrainingType; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.LoRATrainingType.g.cs b/src/libs/Together/Generated/Together.Models.LoRATrainingType.g.cs index e4777d50..350f4114 100644 --- a/src/libs/Together/Generated/Together.Models.LoRATrainingType.g.cs +++ b/src/libs/Together/Generated/Together.Models.LoRATrainingType.g.cs @@ -30,12 +30,13 @@ public sealed partial class LoRATrainingType public required int LoraAlpha { get; set; } /// - /// Default Value: 0 + /// Default Value: 0.0 /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_dropout")] - public float? LoraDropout { get; set; } + public double? LoraDropout { get; set; } /// + /// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE expert modules (`w_up`, `w_gate`, `w_down`) are supported on compatible models and cannot be mixed with attention modules.
/// Default Value: all-linear ///
[global::System.Text.Json.Serialization.JsonPropertyName("lora_trainable_modules")] @@ -54,9 +55,10 @@ public sealed partial class LoRATrainingType /// /// /// - /// Default Value: 0 + /// Default Value: 0.0 /// /// + /// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE expert modules (`w_up`, `w_gate`, `w_down`) are supported on compatible models and cannot be mixed with attention modules.
/// Default Value: all-linear /// #if NET7_0_OR_GREATER @@ -66,7 +68,7 @@ public LoRATrainingType( int loraR, int loraAlpha, global::Together.LoRATrainingTypeType type, - float? loraDropout, + double? loraDropout, string? loraTrainableModules) { this.Type = type; diff --git a/src/libs/Together/Generated/Together.Models.LogprobsPart.Json.g.cs b/src/libs/Together/Generated/Together.Models.LogprobsPart.Json.g.cs index ff834130..9704bdd4 100644 --- a/src/libs/Together/Generated/Together.Models.LogprobsPart.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.LogprobsPart.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.LogprobsPart; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.LogprobsPart? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.LogprobsPart; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs index 2567ddca..bb5c6c97 100644 --- a/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs index caab7b12..10818b95 100644 --- a/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelInfoObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelInfoObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelInfoObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs index 011eff79..92fb42ae 100644 --- a/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelUploadRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs index 5129e77f..eb67e591 100644 --- a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelUploadSuccessResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadSuccessResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs index 46efe4bd..3be1ff84 100644 --- a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelUploadSuccessResponseData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponseData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadSuccessResponseData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelVoices.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelVoices.Json.g.cs index acd3defd..4c8f0b60 100644 --- a/src/libs/Together/Generated/Together.Models.ModelVoices.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelVoices.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelVoices; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelVoices? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelVoices; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ModelVoicesVoice.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelVoicesVoice.Json.g.cs index 89fa9322..50cc9926 100644 --- a/src/libs/Together/Generated/Together.Models.ModelVoicesVoice.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ModelVoicesVoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ModelVoicesVoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelVoicesVoice? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelVoicesVoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.MultimodalParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.MultimodalParams.Json.g.cs index 53807a86..df07b97c 100644 --- a/src/libs/Together/Generated/Together.Models.MultimodalParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.MultimodalParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.MultimodalParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.MultimodalParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.MultimodalParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.NodePhaseTransition.Json.g.cs b/src/libs/Together/Generated/Together.Models.NodePhaseTransition.Json.g.cs index b7417c2a..a4bb8f80 100644 --- a/src/libs/Together/Generated/Together.Models.NodePhaseTransition.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.NodePhaseTransition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.NodePhaseTransition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.NodePhaseTransition? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.NodePhaseTransition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.OIDCConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.OIDCConfig.Json.g.cs index 96d1451a..244ae3ce 100644 --- a/src/libs/Together/Generated/Together.Models.OIDCConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.OIDCConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OIDCConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OIDCConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OIDCConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ObservabilityConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.ObservabilityConfig.Json.g.cs index 25c9fb51..532ff18c 100644 --- a/src/libs/Together/Generated/Together.Models.ObservabilityConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ObservabilityConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ObservabilityConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ObservabilityConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ObservabilityConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs index 9d8517e0..be9c7355 100644 --- a/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OutputsItem?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OutputsItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OutputsItem?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.Json.g.cs b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.Json.g.cs new file mode 100644 index 00000000..1571021d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class PassiveHealthCheckAlert + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.PassiveHealthCheckAlert? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.PassiveHealthCheckAlert), + jsonSerializerContext) as global::Together.PassiveHealthCheckAlert; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PassiveHealthCheckAlert? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.PassiveHealthCheckAlert? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.PassiveHealthCheckAlert), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.PassiveHealthCheckAlert; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.g.cs b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.g.cs new file mode 100644 index 00000000..9661f772 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlert.g.cs @@ -0,0 +1,173 @@ + +#nullable enable + +namespace Together +{ + /// + /// Passive health check alert returned by the health check API. + /// + public sealed partial class PassiveHealthCheckAlert + { + /// + /// Primary key UUID for the passive health check alert.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("passive_health_check_alert_id")] + public string PassiveHealthCheckAlertId { get; set; } = default!; + + /// + /// Resolved instance UUID. Empty until the alert is joined to an instance.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("instance_id")] + public string? InstanceId { get; set; } + + /// + /// Cluster UUID the alert was raised against.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("cluster_id")] + public string ClusterId { get; set; } = default!; + + /// + /// VM name extracted from the Alertmanager labels.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("target_vm")] + public string TargetVm { get; set; } = default!; + + /// + /// Alertmanager alert name.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("alert_name")] + public string AlertName { get; set; } = default!; + + /// + /// Canonical severity tier for the alert.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("severity")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter))] + public global::Together.PassiveHealthCheckAlertSeverity Severity { get; set; } = default!; + + /// + /// Alertmanager annotations as key-value strings.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("annotations")] + public global::System.Collections.Generic.Dictionary Annotations { get; set; } = default!; + + /// + /// Time when the underlying alert first fired.
+ /// Included only in responses + ///
+ /// default! + [global::System.Text.Json.Serialization.JsonPropertyName("started_at")] + public global::System.DateTime StartedAt { get; set; } = default!; + + /// + /// Time when the underlying alert resolved. Empty while the alert is firing.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolved_at")] + public global::System.DateTime? ResolvedAt { get; set; } + + /// + /// Remediation intent UUID attached to this alert, if any.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("node_remediation_intent_id")] + public string? NodeRemediationIntentId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Resolved instance UUID. Empty until the alert is joined to an instance.
+ /// Included only in responses + /// + /// + /// Time when the underlying alert resolved. Empty while the alert is firing.
+ /// Included only in responses + /// + /// + /// Remediation intent UUID attached to this alert, if any.
+ /// Included only in responses + /// + /// + /// Primary key UUID for the passive health check alert.
+ /// Included only in responses + /// + /// + /// Cluster UUID the alert was raised against.
+ /// Included only in responses + /// + /// + /// VM name extracted from the Alertmanager labels.
+ /// Included only in responses + /// + /// + /// Alertmanager alert name.
+ /// Included only in responses + /// + /// + /// Canonical severity tier for the alert.
+ /// Included only in responses + /// + /// + /// Alertmanager annotations as key-value strings.
+ /// Included only in responses + /// + /// + /// Time when the underlying alert first fired.
+ /// Included only in responses + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PassiveHealthCheckAlert( + string? instanceId, + global::System.DateTime? resolvedAt, + string? nodeRemediationIntentId, + string passiveHealthCheckAlertId = default!, + string clusterId = default!, + string targetVm = default!, + string alertName = default!, + global::Together.PassiveHealthCheckAlertSeverity severity = default!, + global::System.Collections.Generic.Dictionary annotations = default!, + global::System.DateTime startedAt = default!) + { + this.PassiveHealthCheckAlertId = passiveHealthCheckAlertId; + this.InstanceId = instanceId; + this.ClusterId = clusterId; + this.TargetVm = targetVm; + this.AlertName = alertName; + this.Severity = severity; + this.Annotations = annotations; + this.StartedAt = startedAt; + this.ResolvedAt = resolvedAt; + this.NodeRemediationIntentId = nodeRemediationIntentId; + } + + /// + /// Initializes a new instance of the class. + /// + public PassiveHealthCheckAlert() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.Json.g.cs b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.Json.g.cs new file mode 100644 index 00000000..a9d4f300 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class PassiveHealthCheckAlertAnnotations + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.PassiveHealthCheckAlertAnnotations? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.PassiveHealthCheckAlertAnnotations), + jsonSerializerContext) as global::Together.PassiveHealthCheckAlertAnnotations; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PassiveHealthCheckAlertAnnotations? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.PassiveHealthCheckAlertAnnotations? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.PassiveHealthCheckAlertAnnotations), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.PassiveHealthCheckAlertAnnotations; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.g.cs b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.g.cs new file mode 100644 index 00000000..846311d6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertAnnotations.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace Together +{ + /// + /// Alertmanager annotations as key-value strings.
+ /// Included only in responses + ///
+ public sealed partial class PassiveHealthCheckAlertAnnotations + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertSeverity.g.cs b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertSeverity.g.cs new file mode 100644 index 00000000..8b24013f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.PassiveHealthCheckAlertSeverity.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// Canonical severity tier for the alert.
+ /// Included only in responses + ///
+ public enum PassiveHealthCheckAlertSeverity + { + /// + /// + /// + PhcSeverityCritical, + /// + /// + /// + PhcSeverityInfo, + /// + /// + /// + PhcSeverityWarning, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PassiveHealthCheckAlertSeverityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PassiveHealthCheckAlertSeverity value) + { + return value switch + { + PassiveHealthCheckAlertSeverity.PhcSeverityCritical => "PHC_SEVERITY_CRITICAL", + PassiveHealthCheckAlertSeverity.PhcSeverityInfo => "PHC_SEVERITY_INFO", + PassiveHealthCheckAlertSeverity.PhcSeverityWarning => "PHC_SEVERITY_WARNING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PassiveHealthCheckAlertSeverity? ToEnum(string value) + { + return value switch + { + "PHC_SEVERITY_CRITICAL" => PassiveHealthCheckAlertSeverity.PhcSeverityCritical, + "PHC_SEVERITY_INFO" => PassiveHealthCheckAlertSeverity.PhcSeverityInfo, + "PHC_SEVERITY_WARNING" => PassiveHealthCheckAlertSeverity.PhcSeverityWarning, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse.Json.g.cs index 009375bc..a2329afa 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse2.Json.g.cs index 273e6f4c..21b046f3 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse3.Json.g.cs index fedf6ca4..c6f1ba84 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse.Json.g.cs index 46de6c8e..ec2a6ae6 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsSecretsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsSecretsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse2.Json.g.cs index 52695114..4d38ca43 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsSecretsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsSecretsResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse3.Json.g.cs index ddac269a..a1b71634 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsSecretsResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsSecretsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsSecretsResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse.Json.g.cs index 09d066d2..9f2eb3cf 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsStorageVolumesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsStorageVolumesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse2.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse2.Json.g.cs index e5880100..11966715 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsStorageVolumesResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsStorageVolumesResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse3.Json.g.cs b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse3.Json.g.cs index 4f27172a..65905980 100644 --- a/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse3.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PatchDeploymentsStorageVolumesResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PatchDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PatchDeploymentsStorageVolumesResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PatchDeploymentsStorageVolumesResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs b/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs index 75b97107..703031d7 100644 --- a/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.Pricing; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Pricing? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.Pricing; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.PromptPartItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.PromptPartItem.Json.g.cs index 83a35782..f6b8576c 100644 --- a/src/libs/Together/Generated/Together.Models.PromptPartItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.PromptPartItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.PromptPartItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.PromptPartItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.PromptPartItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueAutoscalingConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueAutoscalingConfig.Json.g.cs index 7f824f57..97a87d17 100644 --- a/src/libs/Together/Generated/Together.Models.QueueAutoscalingConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueAutoscalingConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueAutoscalingConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueAutoscalingConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueAutoscalingConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueCancelRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueCancelRequest.Json.g.cs index baec7fb2..be887376 100644 --- a/src/libs/Together/Generated/Together.Models.QueueCancelRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueCancelRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueCancelRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueCancelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueCancelRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueCancelRequest.g.cs b/src/libs/Together/Generated/Together.Models.QueueCancelRequest.g.cs index 8bc2729f..bca89f3b 100644 --- a/src/libs/Together/Generated/Together.Models.QueueCancelRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueCancelRequest.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Request to cancel a queued job. /// public sealed partial class QueueCancelRequest { diff --git a/src/libs/Together/Generated/Together.Models.QueueCancelResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueCancelResponse.Json.g.cs index e4580e5d..07cce01b 100644 --- a/src/libs/Together/Generated/Together.Models.QueueCancelResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueCancelResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueCancelResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueCancelResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueCancelResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueCancelResponse.g.cs b/src/libs/Together/Generated/Together.Models.QueueCancelResponse.g.cs index 15fffc1c..3d375fe9 100644 --- a/src/libs/Together/Generated/Together.Models.QueueCancelResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueCancelResponse.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Status returned after a cancel attempt. /// public sealed partial class QueueCancelResponse { diff --git a/src/libs/Together/Generated/Together.Models.QueueClearRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueClearRequest.Json.g.cs new file mode 100644 index 00000000..85212ef6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.QueueClearRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class QueueClearRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.QueueClearRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.QueueClearRequest), + jsonSerializerContext) as global::Together.QueueClearRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueClearRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.QueueClearRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.QueueClearRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueClearRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.QueueClearRequest.g.cs b/src/libs/Together/Generated/Together.Models.QueueClearRequest.g.cs new file mode 100644 index 00000000..08178006 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.QueueClearRequest.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request to clear pending jobs for a model. + /// + public sealed partial class QueueClearRequest + { + /// + /// Model identifier whose pending jobs should be canceled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Model identifier whose pending jobs should be canceled + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public QueueClearRequest( + string model) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + } + + /// + /// Initializes a new instance of the class. + /// + public QueueClearRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.QueueClearResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueClearResponse.Json.g.cs new file mode 100644 index 00000000..522cf40f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.QueueClearResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class QueueClearResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.QueueClearResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.QueueClearResponse), + jsonSerializerContext) as global::Together.QueueClearResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueClearResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.QueueClearResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.QueueClearResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueClearResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.QueueClearResponse.g.cs b/src/libs/Together/Generated/Together.Models.QueueClearResponse.g.cs new file mode 100644 index 00000000..3251db6e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.QueueClearResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Count of pending jobs canceled by the clear operation. + /// + public sealed partial class QueueClearResponse + { + /// + /// Number of pending jobs that were canceled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("canceled_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CanceledCount { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of pending jobs that were canceled + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public QueueClearResponse( + int canceledCount) + { + this.CanceledCount = canceledCount; + } + + /// + /// Initializes a new instance of the class. + /// + public QueueClearResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.QueueError.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueError.Json.g.cs index e1afa8fa..bbbf9e6a 100644 --- a/src/libs/Together/Generated/Together.Models.QueueError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueError.g.cs b/src/libs/Together/Generated/Together.Models.QueueError.g.cs index 2f272503..556eaf51 100644 --- a/src/libs/Together/Generated/Together.Models.QueueError.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueError.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Error response returned by queue endpoints. /// public sealed partial class QueueError { diff --git a/src/libs/Together/Generated/Together.Models.QueueJobRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobRequest.Json.g.cs index 0724eeae..ff787eda 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobRequest.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobRequest.g.cs index fb059e6d..cb70cc20 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobRequest.g.cs @@ -4,21 +4,23 @@ namespace Together { /// - /// + /// Request to submit a job to the queue. /// public sealed partial class QueueJobRequest { /// - /// Arbitrary JSON metadata stored with the job and returned in status
- /// responses. The model and system may add or update keys during
- /// processing. + /// Arbitrary JSON metadata stored with the job. Returned in status
+ /// responses, where the model and system may have added or modified
+ /// keys (e.g. progress). ///
[global::System.Text.Json.Serialization.JsonPropertyName("info")] public object? Info { get; set; } /// - /// Required model identifier + /// Required model identifier
+ /// Example: my-queue-model ///
+ /// my-queue-model [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonRequired] public required string Model { get; set; } @@ -49,15 +51,16 @@ public sealed partial class QueueJobRequest /// Initializes a new instance of the class. ///
/// - /// Required model identifier + /// Required model identifier
+ /// Example: my-queue-model /// /// /// Freeform model input. Passed unchanged to the model. Contents are model-specific. /// /// - /// Arbitrary JSON metadata stored with the job and returned in status
- /// responses. The model and system may add or update keys during
- /// processing. + /// Arbitrary JSON metadata stored with the job. Returned in status
+ /// responses, where the model and system may have added or modified
+ /// keys (e.g. progress). /// /// /// Job priority. Higher values are processed first (strict priority
diff --git a/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.Json.g.cs index a30e438c..944c176b 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobRequestInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobRequestInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobRequestInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.g.cs index 7ac66287..f394c36a 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobRequestInfo.g.cs @@ -4,9 +4,9 @@ namespace Together { /// - /// Arbitrary JSON metadata stored with the job and returned in status
- /// responses. The model and system may add or update keys during
- /// processing. + /// Arbitrary JSON metadata stored with the job. Returned in status
+ /// responses, where the model and system may have added or modified
+ /// keys (e.g. progress). ///
public sealed partial class QueueJobRequestInfo { diff --git a/src/libs/Together/Generated/Together.Models.QueueJobRequestPayload.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobRequestPayload.Json.g.cs index feefb670..525537d2 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobRequestPayload.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobRequestPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobRequestPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobRequestPayload? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobRequestPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobResponse.Json.g.cs index 1ec055c9..45af248b 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobResponse.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobResponse.g.cs index 5231b348..33acf9f5 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobResponse.g.cs @@ -4,21 +4,16 @@ namespace Together { /// - /// + /// Response returned after queueing a job. /// public sealed partial class QueueJobResponse { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public global::Together.QueueError? Error { get; set; } - /// /// Unique identifier for the submitted job. Use this to poll status or cancel. /// [global::System.Text.Json.Serialization.JsonPropertyName("requestId")] - public string? RequestId { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required string RequestId { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,7 +24,6 @@ public sealed partial class QueueJobResponse /// /// Initializes a new instance of the class. /// - /// /// /// Unique identifier for the submitted job. Use this to poll status or cancel. /// @@ -37,11 +31,9 @@ public sealed partial class QueueJobResponse [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public QueueJobResponse( - global::Together.QueueError? error, - string? requestId) + string requestId) { - this.Error = error; - this.RequestId = requestId; + this.RequestId = requestId ?? throw new global::System.ArgumentNullException(nameof(requestId)); } /// diff --git a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.Json.g.cs index 2ae7bb72..121ed76e 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobStatusResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobStatusResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.g.cs index e8fda6dc..bc946c9b 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponse.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Current status and metadata for a queued job. /// public sealed partial class QueueJobStatusResponse { diff --git a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInfo.Json.g.cs index 4caa521f..99f60201 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInfo.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobStatusResponseInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobStatusResponseInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobStatusResponseInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInputs.Json.g.cs index 77207ee8..829bb4cd 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInputs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseInputs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobStatusResponseInputs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobStatusResponseInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobStatusResponseInputs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseOutputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseOutputs.Json.g.cs index 9a02b237..1b90ca86 100644 --- a/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseOutputs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueJobStatusResponseOutputs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueJobStatusResponseOutputs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueJobStatusResponseOutputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueJobStatusResponseOutputs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.Json.g.cs index 0e2bf1d0..6bf48342 100644 --- a/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.QueueMetricsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.QueueMetricsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.QueueMetricsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.g.cs b/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.g.cs index d4e59c5a..cb9240cf 100644 --- a/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.QueueMetricsResponse.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Queue job counts for a model. /// public sealed partial class QueueMetricsResponse { diff --git a/src/libs/Together/Generated/Together.Models.RegionListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RegionListResponse.Json.g.cs index 642dea45..6c4523b0 100644 --- a/src/libs/Together/Generated/Together.Models.RegionListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RegionListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RegionListResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RegionListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RegionListResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RegionListResponseRegion.Json.g.cs b/src/libs/Together/Generated/Together.Models.RegionListResponseRegion.Json.g.cs index 0f0569d6..105dba98 100644 --- a/src/libs/Together/Generated/Together.Models.RegionListResponseRegion.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RegionListResponseRegion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RegionListResponseRegion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RegionListResponseRegion? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RegionListResponseRegion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.Remediation.Json.g.cs b/src/libs/Together/Generated/Together.Models.Remediation.Json.g.cs index abe6db77..b7833d9a 100644 --- a/src/libs/Together/Generated/Together.Models.Remediation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Remediation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.Remediation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Remediation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.Remediation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.Remediation.g.cs b/src/libs/Together/Generated/Together.Models.Remediation.g.cs index ca08d7d8..1750358f 100644 --- a/src/libs/Together/Generated/Together.Models.Remediation.g.cs +++ b/src/libs/Together/Generated/Together.Models.Remediation.g.cs @@ -33,7 +33,10 @@ public sealed partial class Remediation /// /// Remediation mode specifies how the remediation should be performed.
/// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
- /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. ///
[global::System.Text.Json.Serialization.JsonPropertyName("mode")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RemediationModeJsonConverter))] @@ -60,6 +63,8 @@ public sealed partial class Remediation /// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
/// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
/// Included only in responses ///
/// default! @@ -150,6 +155,20 @@ public sealed partial class Remediation [global::System.Text.Json.Serialization.JsonPropertyName("update_time")] public global::System.DateTime? UpdateTime { get; set; } + /// + /// Display name of the targeted instance.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("instance_name")] + public string? InstanceName { get; set; } + + /// + /// Passive health check alerts linked to this remediation, including resolved alerts.
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("linked_alerts")] + public global::System.Collections.Generic.IList? LinkedAlerts { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -162,7 +181,10 @@ public sealed partial class Remediation /// /// Remediation mode specifies how the remediation should be performed.
/// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
- /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. /// /// /// User-provided reason for the remediation. @@ -211,6 +233,14 @@ public sealed partial class Remediation /// When the remediation was last updated.
/// Included only in responses /// + /// + /// Display name of the targeted instance.
+ /// Included only in responses + /// + /// + /// Passive health check alerts linked to this remediation, including resolved alerts.
+ /// Included only in responses + /// /// /// Included only in responses /// @@ -235,6 +265,8 @@ public sealed partial class Remediation /// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
/// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
/// Included only in responses /// #if NET7_0_OR_GREATER @@ -254,6 +286,8 @@ public Remediation( global::System.DateTime? endTime, string? errorMessage, global::System.DateTime? updateTime, + string? instanceName, + global::System.Collections.Generic.IList? linkedAlerts, string id = default!, string clusterId = default!, string instanceId = default!, @@ -278,6 +312,8 @@ public Remediation( this.EndTime = endTime; this.ErrorMessage = errorMessage; this.UpdateTime = updateTime; + this.InstanceName = instanceName; + this.LinkedAlerts = linkedAlerts; } /// diff --git a/src/libs/Together/Generated/Together.Models.RemediationMode.g.cs b/src/libs/Together/Generated/Together.Models.RemediationMode.g.cs index e49b1dec..dfe08f7f 100644 --- a/src/libs/Together/Generated/Together.Models.RemediationMode.g.cs +++ b/src/libs/Together/Generated/Together.Models.RemediationMode.g.cs @@ -6,12 +6,15 @@ namespace Together /// /// Remediation mode specifies how the remediation should be performed.
/// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
- /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. ///
public enum RemediationMode { /// - /// + /// Evicts the VM without provisioning a replacement. /// EvictWithoutReplacement, /// @@ -19,7 +22,11 @@ public enum RemediationMode /// HostAware, /// - /// + /// Cordons and power-cycles the bare-metal host while preserving host and node identity. + /// + HostPowerCycle, + /// + /// Reboots the VM in place. /// RebootVm, /// @@ -42,6 +49,7 @@ public static string ToValueString(this RemediationMode value) { RemediationMode.EvictWithoutReplacement => "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", RemediationMode.HostAware => "REMEDIATION_MODE_HOST_AWARE", + RemediationMode.HostPowerCycle => "REMEDIATION_MODE_HOST_POWER_CYCLE", RemediationMode.RebootVm => "REMEDIATION_MODE_REBOOT_VM", RemediationMode.VmOnly => "REMEDIATION_MODE_VM_ONLY", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -56,6 +64,7 @@ public static string ToValueString(this RemediationMode value) { "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT" => RemediationMode.EvictWithoutReplacement, "REMEDIATION_MODE_HOST_AWARE" => RemediationMode.HostAware, + "REMEDIATION_MODE_HOST_POWER_CYCLE" => RemediationMode.HostPowerCycle, "REMEDIATION_MODE_REBOOT_VM" => RemediationMode.RebootVm, "REMEDIATION_MODE_VM_ONLY" => RemediationMode.VmOnly, _ => null, diff --git a/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsMode.g.cs b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsModeItem.g.cs similarity index 50% rename from src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsMode.g.cs rename to src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsModeItem.g.cs index 90a54782..b9de2eb4 100644 --- a/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsMode.g.cs +++ b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsModeItem.g.cs @@ -4,9 +4,9 @@ namespace Together { /// - /// Filter by remediation mode. Returns only remediations matching the specified mode. + /// /// - public enum RemediationServiceListRemediationsMode + public enum RemediationServiceListRemediationsModeItem { /// /// @@ -19,6 +19,10 @@ public enum RemediationServiceListRemediationsMode /// /// /// + RemediationModeHostPowerCycle, + /// + /// + /// RemediationModeRebootVm, /// /// @@ -29,33 +33,35 @@ public enum RemediationServiceListRemediationsMode /// /// Enum extensions to do fast conversions without the reflection. /// - public static class RemediationServiceListRemediationsModeExtensions + public static class RemediationServiceListRemediationsModeItemExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this RemediationServiceListRemediationsMode value) + public static string ToValueString(this RemediationServiceListRemediationsModeItem value) { return value switch { - RemediationServiceListRemediationsMode.RemediationModeEvictWithoutReplacement => "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", - RemediationServiceListRemediationsMode.RemediationModeHostAware => "REMEDIATION_MODE_HOST_AWARE", - RemediationServiceListRemediationsMode.RemediationModeRebootVm => "REMEDIATION_MODE_REBOOT_VM", - RemediationServiceListRemediationsMode.RemediationModeVmOnly => "REMEDIATION_MODE_VM_ONLY", + RemediationServiceListRemediationsModeItem.RemediationModeEvictWithoutReplacement => "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", + RemediationServiceListRemediationsModeItem.RemediationModeHostAware => "REMEDIATION_MODE_HOST_AWARE", + RemediationServiceListRemediationsModeItem.RemediationModeHostPowerCycle => "REMEDIATION_MODE_HOST_POWER_CYCLE", + RemediationServiceListRemediationsModeItem.RemediationModeRebootVm => "REMEDIATION_MODE_REBOOT_VM", + RemediationServiceListRemediationsModeItem.RemediationModeVmOnly => "REMEDIATION_MODE_VM_ONLY", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static RemediationServiceListRemediationsMode? ToEnum(string value) + public static RemediationServiceListRemediationsModeItem? ToEnum(string value) { return value switch { - "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT" => RemediationServiceListRemediationsMode.RemediationModeEvictWithoutReplacement, - "REMEDIATION_MODE_HOST_AWARE" => RemediationServiceListRemediationsMode.RemediationModeHostAware, - "REMEDIATION_MODE_REBOOT_VM" => RemediationServiceListRemediationsMode.RemediationModeRebootVm, - "REMEDIATION_MODE_VM_ONLY" => RemediationServiceListRemediationsMode.RemediationModeVmOnly, + "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT" => RemediationServiceListRemediationsModeItem.RemediationModeEvictWithoutReplacement, + "REMEDIATION_MODE_HOST_AWARE" => RemediationServiceListRemediationsModeItem.RemediationModeHostAware, + "REMEDIATION_MODE_HOST_POWER_CYCLE" => RemediationServiceListRemediationsModeItem.RemediationModeHostPowerCycle, + "REMEDIATION_MODE_REBOOT_VM" => RemediationServiceListRemediationsModeItem.RemediationModeRebootVm, + "REMEDIATION_MODE_VM_ONLY" => RemediationServiceListRemediationsModeItem.RemediationModeVmOnly, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsStateItem.g.cs b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsStateItem.g.cs index c3e6e610..a17ad48d 100644 --- a/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsStateItem.g.cs +++ b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsStateItem.g.cs @@ -31,6 +31,14 @@ public enum RemediationServiceListRemediationsStateItem /// /// /// + Quarantined, + /// + /// + /// + Quarantining, + /// + /// + /// Running, /// /// @@ -55,6 +63,8 @@ public static string ToValueString(this RemediationServiceListRemediationsStateI RemediationServiceListRemediationsStateItem.Failed => "FAILED", RemediationServiceListRemediationsStateItem.Pending => "PENDING", RemediationServiceListRemediationsStateItem.PendingApproval => "PENDING_APPROVAL", + RemediationServiceListRemediationsStateItem.Quarantined => "QUARANTINED", + RemediationServiceListRemediationsStateItem.Quarantining => "QUARANTINING", RemediationServiceListRemediationsStateItem.Running => "RUNNING", RemediationServiceListRemediationsStateItem.Succeeded => "SUCCEEDED", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -72,6 +82,8 @@ public static string ToValueString(this RemediationServiceListRemediationsStateI "FAILED" => RemediationServiceListRemediationsStateItem.Failed, "PENDING" => RemediationServiceListRemediationsStateItem.Pending, "PENDING_APPROVAL" => RemediationServiceListRemediationsStateItem.PendingApproval, + "QUARANTINED" => RemediationServiceListRemediationsStateItem.Quarantined, + "QUARANTINING" => RemediationServiceListRemediationsStateItem.Quarantining, "RUNNING" => RemediationServiceListRemediationsStateItem.Running, "SUCCEEDED" => RemediationServiceListRemediationsStateItem.Succeeded, _ => null, diff --git a/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsTriggerItem.g.cs b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsTriggerItem.g.cs new file mode 100644 index 00000000..242bfbe6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemediationServiceListRemediationsTriggerItem.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum RemediationServiceListRemediationsTriggerItem + { + /// + /// + /// + RemediationTriggerAutomated, + /// + /// + /// + RemediationTriggerManual, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RemediationServiceListRemediationsTriggerItemExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RemediationServiceListRemediationsTriggerItem value) + { + return value switch + { + RemediationServiceListRemediationsTriggerItem.RemediationTriggerAutomated => "REMEDIATION_TRIGGER_AUTOMATED", + RemediationServiceListRemediationsTriggerItem.RemediationTriggerManual => "REMEDIATION_TRIGGER_MANUAL", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RemediationServiceListRemediationsTriggerItem? ToEnum(string value) + { + return value switch + { + "REMEDIATION_TRIGGER_AUTOMATED" => RemediationServiceListRemediationsTriggerItem.RemediationTriggerAutomated, + "REMEDIATION_TRIGGER_MANUAL" => RemediationServiceListRemediationsTriggerItem.RemediationTriggerManual, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RemediationState.g.cs b/src/libs/Together/Generated/Together.Models.RemediationState.g.cs index 236db927..062b94e2 100644 --- a/src/libs/Together/Generated/Together.Models.RemediationState.g.cs +++ b/src/libs/Together/Generated/Together.Models.RemediationState.g.cs @@ -12,6 +12,8 @@ namespace Together /// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
/// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
/// Included only in responses ///
public enum RemediationState @@ -37,6 +39,14 @@ public enum RemediationState ///
PendingApproval, /// + /// Host has been cordoned or isolated for remediation. + /// + Quarantined, + /// + /// Cordoning or preparing the host before remediation. + /// + Quarantining, + /// /// Actively being processed. /// Running, @@ -63,6 +73,8 @@ public static string ToValueString(this RemediationState value) RemediationState.Failed => "FAILED", RemediationState.Pending => "PENDING", RemediationState.PendingApproval => "PENDING_APPROVAL", + RemediationState.Quarantined => "QUARANTINED", + RemediationState.Quarantining => "QUARANTINING", RemediationState.Running => "RUNNING", RemediationState.Succeeded => "SUCCEEDED", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -80,6 +92,8 @@ public static string ToValueString(this RemediationState value) "FAILED" => RemediationState.Failed, "PENDING" => RemediationState.Pending, "PENDING_APPROVAL" => RemediationState.PendingApproval, + "QUARANTINED" => RemediationState.Quarantined, + "QUARANTINING" => RemediationState.Quarantining, "RUNNING" => RemediationState.Running, "SUCCEEDED" => RemediationState.Succeeded, _ => null, diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs new file mode 100644 index 00000000..76a6a62d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RemoveAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RemoveAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RemoveAdapterRequest), + jsonSerializerContext) as global::Together.RemoveAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RemoveAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RemoveAdapterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RemoveAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RemoveAdapterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs new file mode 100644 index 00000000..3d8d06fc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RemoveAdapterRequest + { + /// + /// Combined identifier in format "endpoint_name:adapter_model_name". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name". + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RemoveAdapterRequest( + string modelId) + { + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + } + + /// + /// Initializes a new instance of the class. + /// + public RemoveAdapterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs new file mode 100644 index 00000000..daa27903 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RemoveAdapterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RemoveAdapterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RemoveAdapterResponse), + jsonSerializerContext) as global::Together.RemoveAdapterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RemoveAdapterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RemoveAdapterResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RemoveAdapterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RemoveAdapterResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs new file mode 100644 index 00000000..a93a283a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RemoveAdapterResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] + public bool? Deleted { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RemoveAdapterResponse( + string? modelId, + bool? deleted) + { + this.ModelId = modelId; + this.Deleted = deleted; + } + + /// + /// Initializes a new instance of the class. + /// + public RemoveAdapterResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ReplicaEvent.Json.g.cs b/src/libs/Together/Generated/Together.Models.ReplicaEvent.Json.g.cs index bb9d003e..9094b5fd 100644 --- a/src/libs/Together/Generated/Together.Models.ReplicaEvent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ReplicaEvent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ReplicaEvent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ReplicaEvent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ReplicaEvent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankRequest.Json.g.cs index 9b6a4f13..1af4b46c 100644 --- a/src/libs/Together/Generated/Together.Models.RerankRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankRequestDocumentsVariant1Item.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankRequestDocumentsVariant1Item.Json.g.cs index 70fa89b9..87049fb1 100644 --- a/src/libs/Together/Generated/Together.Models.RerankRequestDocumentsVariant1Item.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankRequestDocumentsVariant1Item.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankRequestDocumentsVariant1Item; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankRequestDocumentsVariant1Item? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankRequestDocumentsVariant1Item; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankResponse.Json.g.cs index b57b56fe..701f4320 100644 --- a/src/libs/Together/Generated/Together.Models.RerankResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankResponseObject.Json.g.cs index d3613730..15cffa7f 100644 --- a/src/libs/Together/Generated/Together.Models.RerankResponseObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankResponseObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankResponseObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankResponseObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankResponseResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankResponseResult.Json.g.cs index 68211d5f..95b3af74 100644 --- a/src/libs/Together/Generated/Together.Models.RerankResponseResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankResponseResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankResponseResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankResponseResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankResponseResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RerankResponseResultDocument.Json.g.cs b/src/libs/Together/Generated/Together.Models.RerankResponseResultDocument.Json.g.cs index 975d2030..754c3445 100644 --- a/src/libs/Together/Generated/Together.Models.RerankResponseResultDocument.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RerankResponseResultDocument.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RerankResponseResultDocument; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RerankResponseResultDocument? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RerankResponseResultDocument; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.Response.Json.g.cs b/src/libs/Together/Generated/Together.Models.Response.Json.g.cs index f0212969..5021f9a7 100644 --- a/src/libs/Together/Generated/Together.Models.Response.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Response.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.Response; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Response? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.Response; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs index 39b97963..a2f0bddf 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormat.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormat.Json.g.cs index b76177f3..d2ddcf15 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormat.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormat?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormat?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonObject.Json.g.cs index 5e61488c..3166bd21 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatJsonObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatJsonObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatJsonObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchema.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchema.Json.g.cs index 61327ace..b7b84988 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchema.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatJsonSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatJsonSchema? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatJsonSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchema.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchema.Json.g.cs index 55208f16..2518f16f 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchema.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatJsonSchemaJsonSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatJsonSchemaJsonSchema? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatJsonSchemaJsonSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchemaStrict.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchemaStrict.Json.g.cs index fda72157..e373d30d 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchemaStrict.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaJsonSchemaStrict.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatJsonSchemaJsonSchemaStrict; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatJsonSchemaJsonSchemaStrict? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatJsonSchemaJsonSchemaStrict; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaSchema.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaSchema.Json.g.cs index 15870baf..94fff030 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaSchema.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatJsonSchemaSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatJsonSchemaSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatJsonSchemaSchema? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatJsonSchemaSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ResponseFormatText.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseFormatText.Json.g.cs index 1390feb6..bef210a7 100644 --- a/src/libs/Together/Generated/Together.Models.ResponseFormatText.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ResponseFormatText.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ResponseFormatText; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseFormatText? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseFormatText; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.Json.g.cs new file mode 100644 index 00000000..52ae391e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlAdamWOptimizerConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlAdamWOptimizerConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlAdamWOptimizerConfig), + jsonSerializerContext) as global::Together.RlAdamWOptimizerConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlAdamWOptimizerConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlAdamWOptimizerConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlAdamWOptimizerConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlAdamWOptimizerConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.g.cs new file mode 100644 index 00000000..c3e63669 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerConfig.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// AdamW optimizer configuration + /// + public sealed partial class RlAdamWOptimizerConfig + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.Json.g.cs index 64609671..778f2f82 100644 --- a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlAdamWOptimizerParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlAdamWOptimizerParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlAdamWOptimizerParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.g.cs b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.g.cs index 0a6e374b..4eb59204 100644 --- a/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlAdamWOptimizerParams.g.cs @@ -4,27 +4,35 @@ namespace Together { /// - /// AdamW optimizer parameters + /// Per-step AdamW optimizer overrides. /// public sealed partial class RlAdamWOptimizerParams { /// - /// First moment decay rate
+ /// Learning rate for the AdamW-tuned parameters
+ /// Example: 0.0001 + ///
+ /// 0.0001 + [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] + public double? LearningRate { get; set; } + + /// + /// Exponential decay rate for the first-moment estimate
/// Default Value: 0.9
/// Example: 0.9 ///
/// 0.9 [global::System.Text.Json.Serialization.JsonPropertyName("beta1")] - public float? Beta1 { get; set; } + public double? Beta1 { get; set; } /// - /// Second moment decay rate
+ /// Exponential decay rate for the second-moment estimate
/// Default Value: 0.95
/// Example: 0.95 ///
/// 0.95 [global::System.Text.Json.Serialization.JsonPropertyName("beta2")] - public float? Beta2 { get; set; } + public double? Beta2 { get; set; } /// /// Epsilon for numerical stability
@@ -33,16 +41,16 @@ public sealed partial class RlAdamWOptimizerParams ///
/// 0.00000001 [global::System.Text.Json.Serialization.JsonPropertyName("eps")] - public float? Eps { get; set; } + public double? Eps { get; set; } /// /// Weight decay coefficient
- /// Default Value: 0.1
+ /// Default Value: 0
/// Example: 0.1 ///
/// 0.1 [global::System.Text.Json.Serialization.JsonPropertyName("weight_decay")] - public float? WeightDecay { get; set; } + public double? WeightDecay { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -53,13 +61,17 @@ public sealed partial class RlAdamWOptimizerParams /// /// Initializes a new instance of the class. /// + /// + /// Learning rate for the AdamW-tuned parameters
+ /// Example: 0.0001 + /// /// - /// First moment decay rate
+ /// Exponential decay rate for the first-moment estimate
/// Default Value: 0.9
/// Example: 0.9 /// /// - /// Second moment decay rate
+ /// Exponential decay rate for the second-moment estimate
/// Default Value: 0.95
/// Example: 0.95 /// @@ -70,18 +82,20 @@ public sealed partial class RlAdamWOptimizerParams /// /// /// Weight decay coefficient
- /// Default Value: 0.1
+ /// Default Value: 0
/// Example: 0.1 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlAdamWOptimizerParams( - float? beta1, - float? beta2, - float? eps, - float? weightDecay) + double? learningRate, + double? beta1, + double? beta2, + double? eps, + double? weightDecay) { + this.LearningRate = learningRate; this.Beta1 = beta1; this.Beta2 = beta2; this.Eps = eps; diff --git a/src/libs/Together/Generated/Together.Models.RlCheckpointDownloadResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCheckpointDownloadResponse.Json.g.cs index cd1e11e4..01cdd90c 100644 --- a/src/libs/Together/Generated/Together.Models.RlCheckpointDownloadResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlCheckpointDownloadResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlCheckpointDownloadResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCheckpointDownloadResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCheckpointDownloadResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlCheckpointFile.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCheckpointFile.Json.g.cs index 18cc5a5b..b2fbb9b7 100644 --- a/src/libs/Together/Generated/Together.Models.RlCheckpointFile.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlCheckpointFile.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlCheckpointFile; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCheckpointFile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCheckpointFile; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.Json.g.cs new file mode 100644 index 00000000..0663210f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCispoLossInputs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCispoLossInputs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCispoLossInputs), + jsonSerializerContext) as global::Together.RlCispoLossInputs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCispoLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCispoLossInputs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCispoLossInputs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCispoLossInputs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.g.cs b/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.g.cs new file mode 100644 index 00000000..90709e9d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCispoLossInputs.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlCispoLossInputs + { + /// + /// Per-token advantages for CISPO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("advantages")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossAdvantages Advantages { get; set; } + + /// + /// Generator log probabilities for CISPO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("generator_logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossLogprobs GeneratorLogprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-token advantages for CISPO + /// + /// + /// Generator log probabilities for CISPO + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlCispoLossInputs( + global::Together.RlLossAdvantages advantages, + global::Together.RlLossLogprobs generatorLogprobs) + { + this.Advantages = advantages ?? throw new global::System.ArgumentNullException(nameof(advantages)); + this.GeneratorLogprobs = generatorLogprobs ?? throw new global::System.ArgumentNullException(nameof(generatorLogprobs)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlCispoLossInputs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlCispoLossParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCispoLossParams.Json.g.cs new file mode 100644 index 00000000..4af43f19 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCispoLossParams.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCispoLossParams + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCispoLossParams? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCispoLossParams), + jsonSerializerContext) as global::Together.RlCispoLossParams; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCispoLossParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCispoLossParams? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCispoLossParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCispoLossParams; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCispoLossParams.g.cs b/src/libs/Together/Generated/Together.Models.RlCispoLossParams.g.cs new file mode 100644 index 00000000..bd97d02f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCispoLossParams.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlCispoLossParams + { + /// + /// Lower absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
+ /// Default Value: 0.0
+ /// Example: 0 + ///
+ /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_low_threshold")] + public float? ClipLowThreshold { get; set; } + + /// + /// Upper absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
+ /// Default Value: 4.0
+ /// Example: 4 + ///
+ /// 4 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_high_threshold")] + public float? ClipHighThreshold { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Lower absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
+ /// Default Value: 0.0
+ /// Example: 0 + /// + /// + /// Upper absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
+ /// Default Value: 4.0
+ /// Example: 4 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlCispoLossParams( + float? clipLowThreshold, + float? clipHighThreshold) + { + this.ClipLowThreshold = clipLowThreshold; + this.ClipHighThreshold = clipHighThreshold; + } + + /// + /// Initializes a new instance of the class. + /// + public RlCispoLossParams() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfig.Json.g.cs new file mode 100644 index 00000000..44b10e23 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlComputeConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlComputeConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlComputeConfig), + jsonSerializerContext) as global::Together.RlComputeConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlComputeConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlComputeConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlComputeConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlComputeConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs new file mode 100644 index 00000000..1a9a2fb3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs @@ -0,0 +1,50 @@ + +#nullable enable + +namespace Together +{ + /// + /// Compute layout for a model resource + /// + public sealed partial class RlComputeConfig + { + /// + /// Number of generator replicas. 0 means the resource runs the trainer only, with no generator.
+ /// Example: 1 + ///
+ /// 1 + [global::System.Text.Json.Serialization.JsonPropertyName("num_generator_replicas")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumGeneratorReplicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of generator replicas. 0 means the resource runs the trainer only, with no generator.
+ /// Example: 1 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlComputeConfig( + int numGeneratorReplicas) + { + this.NumGeneratorReplicas = numGeneratorReplicas; + } + + /// + /// Initializes a new instance of the class. + /// + public RlComputeConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.Json.g.cs new file mode 100644 index 00000000..db20de93 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlComputeConfigCreateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlComputeConfigCreateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlComputeConfigCreateRequest), + jsonSerializerContext) as global::Together.RlComputeConfigCreateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlComputeConfigCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlComputeConfigCreateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlComputeConfigCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlComputeConfigCreateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.g.cs new file mode 100644 index 00000000..6266f3f9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequest.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Compute layout to provision for a model resource + /// + public sealed partial class RlComputeConfigCreateRequest + { + /// + /// Number of generator replicas. 0 runs the trainer only, with no generator.
+ /// Default Value: 1
+ /// Example: 2 + ///
+ /// 2 + [global::System.Text.Json.Serialization.JsonPropertyName("num_generator_replicas")] + public int? NumGeneratorReplicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of generator replicas. 0 runs the trainer only, with no generator.
+ /// Default Value: 1
+ /// Example: 2 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlComputeConfigCreateRequest( + int? numGeneratorReplicas) + { + this.NumGeneratorReplicas = numGeneratorReplicas; + } + + /// + /// Initializes a new instance of the class. + /// + public RlComputeConfigCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.Json.g.cs new file mode 100644 index 00000000..b75432af --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCreateModelResourcesRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCreateModelResourcesRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCreateModelResourcesRequest), + jsonSerializerContext) as global::Together.RlCreateModelResourcesRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCreateModelResourcesRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCreateModelResourcesRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCreateModelResourcesRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCreateModelResourcesRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.g.cs b/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.g.cs new file mode 100644 index 00000000..4dbbfaf3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCreateModelResourcesRequest.g.cs @@ -0,0 +1,88 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request to provision a standalone model resource + /// + public sealed partial class RlCreateModelResourcesRequest + { + /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + ///
+ /// Qwen/Qwen3-0.6B + [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModel { get; set; } + + /// + /// Compute layout to provision. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("compute_config")] + public global::Together.RlComputeConfigCreateRequest? ComputeConfig { get; set; } + + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("lora_enabled")] + public bool? LoraEnabled { get; set; } + + /// + /// Optimizer configuration for this resource. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("optimizer_config")] + public global::Together.RlOptimizerConfig? OptimizerConfig { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout to provision. + /// + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Optimizer configuration for this resource. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlCreateModelResourcesRequest( + string baseModel, + global::Together.RlComputeConfigCreateRequest? computeConfig, + bool? loraEnabled, + global::Together.RlOptimizerConfig? optimizerConfig) + { + this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); + this.ComputeConfig = computeConfig; + this.LoraEnabled = loraEnabled; + this.OptimizerConfig = optimizerConfig; + } + + /// + /// Initializes a new instance of the class. + /// + public RlCreateModelResourcesRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlCrossEntropyLossParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCrossEntropyLossParams.Json.g.cs index 39069927..0491009e 100644 --- a/src/libs/Together/Generated/Together.Models.RlCrossEntropyLossParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlCrossEntropyLossParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlCrossEntropyLossParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCrossEntropyLossParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCrossEntropyLossParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.Json.g.cs new file mode 100644 index 00000000..60f8fb46 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCustomForwardBackwardBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCustomForwardBackwardBody), + jsonSerializerContext) as global::Together.RlCustomForwardBackwardBody; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCustomForwardBackwardBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCustomForwardBackwardBody), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCustomForwardBackwardBody; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.g.cs new file mode 100644 index 00000000..18aafea1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardBody.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request body for a custom forward-backward pass. + /// + public sealed partial class RlCustomForwardBackwardBody + { + /// + /// Batch of training samples + /// + [global::System.Text.Json.Serialization.JsonPropertyName("samples")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Samples { get; set; } + + /// + /// Per-sample per-token gradients of the loss with respect to log-probabilities + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gradients")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Gradients { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Batch of training samples + /// + /// + /// Per-sample per-token gradients of the loss with respect to log-probabilities + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlCustomForwardBackwardBody( + global::System.Collections.Generic.IList samples, + global::System.Collections.Generic.IList gradients) + { + this.Samples = samples ?? throw new global::System.ArgumentNullException(nameof(samples)); + this.Gradients = gradients ?? throw new global::System.ArgumentNullException(nameof(gradients)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlCustomForwardBackwardBody() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.Json.g.cs new file mode 100644 index 00000000..afcd4054 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCustomForwardBackwardOperation + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardOperation? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCustomForwardBackwardOperation), + jsonSerializerContext) as global::Together.RlCustomForwardBackwardOperation; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCustomForwardBackwardOperation? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCustomForwardBackwardOperation), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCustomForwardBackwardOperation; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.g.cs new file mode 100644 index 00000000..bea285fe --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardOperation.g.cs @@ -0,0 +1,88 @@ + +#nullable enable + +namespace Together +{ + /// + /// Async custom forward-backward pass operation + /// + public sealed partial class RlCustomForwardBackwardOperation + { + /// + /// Operation ID
+ /// Example: 550e8400-e29b-41d4-a716-446655440000 + ///
+ /// 550e8400-e29b-41d4-a716-446655440000 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Operation status
+ /// Default Value: TRAINING_OPERATION_STATUS_UNSPECIFIED + ///
+ /// global::Together.RlTrainingOperationStatus.TrainingOperationStatusUnspecified + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlTrainingOperationStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlTrainingOperationStatus Status { get; set; } = global::Together.RlTrainingOperationStatus.TrainingOperationStatusUnspecified; + + /// + /// Result on success + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + public global::Together.RlCustomForwardBackwardResult? Output { get; set; } + + /// + /// Error details on failure + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Together.RlTrainingOperationError? Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Operation ID
+ /// Example: 550e8400-e29b-41d4-a716-446655440000 + /// + /// + /// Operation status
+ /// Default Value: TRAINING_OPERATION_STATUS_UNSPECIFIED + /// + /// + /// Result on success + /// + /// + /// Error details on failure + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlCustomForwardBackwardOperation( + string id, + global::Together.RlTrainingOperationStatus status, + global::Together.RlCustomForwardBackwardResult? output, + global::Together.RlTrainingOperationError? error) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Status = status; + this.Output = output; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public RlCustomForwardBackwardOperation() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.Json.g.cs new file mode 100644 index 00000000..d9ac02ae --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlCustomForwardBackwardResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlCustomForwardBackwardResult), + jsonSerializerContext) as global::Together.RlCustomForwardBackwardResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlCustomForwardBackwardResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlCustomForwardBackwardResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlCustomForwardBackwardResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlCustomForwardBackwardResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.g.cs b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.g.cs new file mode 100644 index 00000000..42a7d198 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlCustomForwardBackwardResult.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Result of a custom forward-backward pass operation + /// + public sealed partial class RlCustomForwardBackwardResult + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlDroLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlDroLossInputs.Json.g.cs new file mode 100644 index 00000000..34716d8e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlDroLossInputs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlDroLossInputs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlDroLossInputs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlDroLossInputs), + jsonSerializerContext) as global::Together.RlDroLossInputs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlDroLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlDroLossInputs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlDroLossInputs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlDroLossInputs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlDroLossInputs.g.cs b/src/libs/Together/Generated/Together.Models.RlDroLossInputs.g.cs new file mode 100644 index 00000000..e150b0cc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlDroLossInputs.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlDroLossInputs + { + /// + /// Per-token advantages for DRO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("advantages")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossAdvantages Advantages { get; set; } + + /// + /// Generator log probabilities for DRO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("generator_logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossLogprobs GeneratorLogprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-token advantages for DRO + /// + /// + /// Generator log probabilities for DRO + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlDroLossInputs( + global::Together.RlLossAdvantages advantages, + global::Together.RlLossLogprobs generatorLogprobs) + { + this.Advantages = advantages ?? throw new global::System.ArgumentNullException(nameof(advantages)); + this.GeneratorLogprobs = generatorLogprobs ?? throw new global::System.ArgumentNullException(nameof(generatorLogprobs)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlDroLossInputs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlDroLossParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlDroLossParams.Json.g.cs new file mode 100644 index 00000000..f408fee8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlDroLossParams.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlDroLossParams + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlDroLossParams? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlDroLossParams), + jsonSerializerContext) as global::Together.RlDroLossParams; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlDroLossParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlDroLossParams? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlDroLossParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlDroLossParams; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlDroLossParams.g.cs b/src/libs/Together/Generated/Together.Models.RlDroLossParams.g.cs new file mode 100644 index 00000000..b67a4a5a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlDroLossParams.g.cs @@ -0,0 +1,50 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlDroLossParams + { + /// + /// Coefficient on the quadratic log-ratio penalty. Required; there is no default.
+ /// Example: 0.05 + ///
+ /// 0.05 + [global::System.Text.Json.Serialization.JsonPropertyName("beta")] + [global::System.Text.Json.Serialization.JsonRequired] + public required float Beta { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Coefficient on the quadratic log-ratio penalty. Required; there is no default.
+ /// Example: 0.05 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlDroLossParams( + float beta) + { + this.Beta = beta; + } + + /// + /// Initializes a new instance of the class. + /// + public RlDroLossParams() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlEncodedText.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlEncodedText.Json.g.cs index c5f585e0..ba78e9ed 100644 --- a/src/libs/Together/Generated/Together.Models.RlEncodedText.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlEncodedText.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlEncodedText; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlEncodedText? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlEncodedText; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBackwardBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBackwardBody.Json.g.cs index 5810f8f6..4d581e44 100644 --- a/src/libs/Together/Generated/Together.Models.RlForwardBackwardBody.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlForwardBackwardBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlForwardBackwardBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardBackwardBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardBackwardBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBackwardOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBackwardOperation.Json.g.cs index 1ebd887f..9bb92f48 100644 --- a/src/libs/Together/Generated/Together.Models.RlForwardBackwardOperation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlForwardBackwardOperation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlForwardBackwardOperation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardBackwardOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardBackwardOperation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBackwardResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBackwardResult.Json.g.cs index ea332dca..51304455 100644 --- a/src/libs/Together/Generated/Together.Models.RlForwardBackwardResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlForwardBackwardResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlForwardBackwardResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardBackwardResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardBackwardResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBackwardResultMetrics.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBackwardResultMetrics.Json.g.cs index a93c3120..a71093df 100644 --- a/src/libs/Together/Generated/Together.Models.RlForwardBackwardResultMetrics.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlForwardBackwardResultMetrics.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlForwardBackwardResultMetrics; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardBackwardResultMetrics? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardBackwardResultMetrics; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBody.Json.g.cs new file mode 100644 index 00000000..8c3dcce3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardBody.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlForwardBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlForwardBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlForwardBody), + jsonSerializerContext) as global::Together.RlForwardBody; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlForwardBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlForwardBody), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardBody; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlForwardBody.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardBody.g.cs new file mode 100644 index 00000000..834b5d13 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardBody.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Request body for a forward pass. + /// + public sealed partial class RlForwardBody + { + /// + /// Batch of training samples for which to compute per-token log-probabilities + /// + [global::System.Text.Json.Serialization.JsonPropertyName("samples")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Samples { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Batch of training samples for which to compute per-token log-probabilities + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlForwardBody( + global::System.Collections.Generic.IList samples) + { + this.Samples = samples ?? throw new global::System.ArgumentNullException(nameof(samples)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlForwardBody() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlForwardOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardOperation.Json.g.cs new file mode 100644 index 00000000..c7e8b234 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardOperation.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlForwardOperation + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlForwardOperation? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlForwardOperation), + jsonSerializerContext) as global::Together.RlForwardOperation; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlForwardOperation? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlForwardOperation), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardOperation; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlForwardOperation.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardOperation.g.cs new file mode 100644 index 00000000..491393e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardOperation.g.cs @@ -0,0 +1,88 @@ + +#nullable enable + +namespace Together +{ + /// + /// Async forward pass operation + /// + public sealed partial class RlForwardOperation + { + /// + /// Operation ID
+ /// Example: 550e8400-e29b-41d4-a716-446655440000 + ///
+ /// 550e8400-e29b-41d4-a716-446655440000 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Operation status
+ /// Default Value: TRAINING_OPERATION_STATUS_UNSPECIFIED + ///
+ /// global::Together.RlTrainingOperationStatus.TrainingOperationStatusUnspecified + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlTrainingOperationStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlTrainingOperationStatus Status { get; set; } = global::Together.RlTrainingOperationStatus.TrainingOperationStatusUnspecified; + + /// + /// Result on success + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + public global::Together.RlForwardResult? Output { get; set; } + + /// + /// Error details on failure + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Together.RlTrainingOperationError? Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Operation ID
+ /// Example: 550e8400-e29b-41d4-a716-446655440000 + /// + /// + /// Operation status
+ /// Default Value: TRAINING_OPERATION_STATUS_UNSPECIFIED + /// + /// + /// Result on success + /// + /// + /// Error details on failure + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlForwardOperation( + string id, + global::Together.RlTrainingOperationStatus status, + global::Together.RlForwardResult? output, + global::Together.RlTrainingOperationError? error) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Status = status; + this.Output = output; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public RlForwardOperation() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlForwardResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardResult.Json.g.cs new file mode 100644 index 00000000..dcef0ed7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlForwardResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlForwardResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlForwardResult), + jsonSerializerContext) as global::Together.RlForwardResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlForwardResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlForwardResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlForwardResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlForwardResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlForwardResult.g.cs b/src/libs/Together/Generated/Together.Models.RlForwardResult.g.cs new file mode 100644 index 00000000..8c6eaec5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlForwardResult.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// Result of a forward pass operation + /// + public sealed partial class RlForwardResult + { + /// + /// Per-sample per-token log-probabilities + /// + [global::System.Text.Json.Serialization.JsonPropertyName("logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Logprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-sample per-token log-probabilities + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlForwardResult( + global::System.Collections.Generic.IList logprobs) + { + this.Logprobs = logprobs ?? throw new global::System.ArgumentNullException(nameof(logprobs)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlForwardResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlGRPOLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlGRPOLossInputs.Json.g.cs index 49dd37bf..f18a0c34 100644 --- a/src/libs/Together/Generated/Together.Models.RlGRPOLossInputs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlGRPOLossInputs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlGRPOLossInputs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlGRPOLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlGRPOLossInputs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.Json.g.cs index 3fb25318..3005ce53 100644 --- a/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlGRPOLossParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlGRPOLossParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlGRPOLossParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.g.cs b/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.g.cs index 03ab8a1f..273ead15 100644 --- a/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlGRPOLossParams.g.cs @@ -9,22 +9,22 @@ namespace Together public sealed partial class RlGRPOLossParams { /// - /// Lower clip bound for importance ratio
- /// Default Value: 0.2
- /// Example: 0.2 + /// Lower clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be <= 1.
+ /// Default Value: 0.8
+ /// Example: 0.8 ///
- /// 0.2 - [global::System.Text.Json.Serialization.JsonPropertyName("clip_low")] - public float? ClipLow { get; set; } + /// 0.8 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_low_threshold")] + public float? ClipLowThreshold { get; set; } /// - /// Upper clip bound for importance ratio
- /// Default Value: 0.28
- /// Example: 0.28 + /// Upper clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be >= 1.
+ /// Default Value: 1.2
+ /// Example: 1.2 ///
- /// 0.28 - [global::System.Text.Json.Serialization.JsonPropertyName("clip_high")] - public float? ClipHigh { get; set; } + /// 1.2 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_high_threshold")] + public float? ClipHighThreshold { get; set; } /// /// KL penalty coefficient
@@ -33,7 +33,7 @@ public sealed partial class RlGRPOLossParams ///
/// 0.1 [global::System.Text.Json.Serialization.JsonPropertyName("beta")] - public float? Beta { get; set; } + public double? Beta { get; set; } /// /// Aggregation type for loss computation
@@ -43,6 +43,14 @@ public sealed partial class RlGRPOLossParams [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter))] public global::Together.RlGRPOLossAggregationType? AggType { get; set; } + /// + /// Controls how the importance-sampling ratio is computed in GRPO loss. Defaults to token-level ratios, which is the standard GRPO behavior. Use sequence-level ratios to enable GSPO-style loss calculation instead.
+ /// Default Value: GRPO_LOSS_RATIO_TYPE_TOKEN + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("ratio_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter))] + public global::Together.RlGRPOLossRatioType? RatioType { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -52,15 +60,15 @@ public sealed partial class RlGRPOLossParams /// /// Initializes a new instance of the class. /// - /// - /// Lower clip bound for importance ratio
- /// Default Value: 0.2
- /// Example: 0.2 + /// + /// Lower clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be <= 1.
+ /// Default Value: 0.8
+ /// Example: 0.8 /// - /// - /// Upper clip bound for importance ratio
- /// Default Value: 0.28
- /// Example: 0.28 + /// + /// Upper clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be >= 1.
+ /// Default Value: 1.2
+ /// Example: 1.2 /// /// /// KL penalty coefficient
@@ -71,19 +79,25 @@ public sealed partial class RlGRPOLossParams /// Aggregation type for loss computation
/// Default Value: GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON /// + /// + /// Controls how the importance-sampling ratio is computed in GRPO loss. Defaults to token-level ratios, which is the standard GRPO behavior. Use sequence-level ratios to enable GSPO-style loss calculation instead.
+ /// Default Value: GRPO_LOSS_RATIO_TYPE_TOKEN + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlGRPOLossParams( - float? clipLow, - float? clipHigh, - float? beta, - global::Together.RlGRPOLossAggregationType? aggType) + float? clipLowThreshold, + float? clipHighThreshold, + double? beta, + global::Together.RlGRPOLossAggregationType? aggType, + global::Together.RlGRPOLossRatioType? ratioType) { - this.ClipLow = clipLow; - this.ClipHigh = clipHigh; + this.ClipLowThreshold = clipLowThreshold; + this.ClipHighThreshold = clipHighThreshold; this.Beta = beta; this.AggType = aggType; + this.RatioType = ratioType; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlGRPOLossRatioType.g.cs b/src/libs/Together/Generated/Together.Models.RlGRPOLossRatioType.g.cs new file mode 100644 index 00000000..3bafe64c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlGRPOLossRatioType.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// Controls whether GRPO loss uses token-level or sequence-level importance ratios.
+ /// Default Value: GRPO_LOSS_RATIO_TYPE_TOKEN + ///
+ public enum RlGRPOLossRatioType + { + /// + /// + /// + GrpoLossRatioTypeSequence, + /// + /// + /// + GrpoLossRatioTypeToken, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlGRPOLossRatioTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlGRPOLossRatioType value) + { + return value switch + { + RlGRPOLossRatioType.GrpoLossRatioTypeSequence => "GRPO_LOSS_RATIO_TYPE_SEQUENCE", + RlGRPOLossRatioType.GrpoLossRatioTypeToken => "GRPO_LOSS_RATIO_TYPE_TOKEN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlGRPOLossRatioType? ToEnum(string value) + { + return value switch + { + "GRPO_LOSS_RATIO_TYPE_SEQUENCE" => RlGRPOLossRatioType.GrpoLossRatioTypeSequence, + "GRPO_LOSS_RATIO_TYPE_TOKEN" => RlGRPOLossRatioType.GrpoLossRatioTypeToken, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.Json.g.cs new file mode 100644 index 00000000..468c8021 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlImportanceSamplingLossInputs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlImportanceSamplingLossInputs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlImportanceSamplingLossInputs), + jsonSerializerContext) as global::Together.RlImportanceSamplingLossInputs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlImportanceSamplingLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlImportanceSamplingLossInputs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlImportanceSamplingLossInputs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlImportanceSamplingLossInputs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.g.cs b/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.g.cs new file mode 100644 index 00000000..7a8ba892 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlImportanceSamplingLossInputs.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Loss inputs for unclipped importance-sampling policy-gradient updates. + /// + public sealed partial class RlImportanceSamplingLossInputs + { + /// + /// Per-token advantages for importance sampling + /// + [global::System.Text.Json.Serialization.JsonPropertyName("advantages")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossAdvantages Advantages { get; set; } + + /// + /// Generator log probabilities for importance sampling + /// + [global::System.Text.Json.Serialization.JsonPropertyName("generator_logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossLogprobs GeneratorLogprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-token advantages for importance sampling + /// + /// + /// Generator log probabilities for importance sampling + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlImportanceSamplingLossInputs( + global::Together.RlLossAdvantages advantages, + global::Together.RlLossLogprobs generatorLogprobs) + { + this.Advantages = advantages ?? throw new global::System.ArgumentNullException(nameof(advantages)); + this.GeneratorLogprobs = generatorLogprobs ?? throw new global::System.ArgumentNullException(nameof(generatorLogprobs)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlImportanceSamplingLossInputs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpoint.Json.g.cs index 0d9ff925..b59961ba 100644 --- a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpoint.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlInferenceCheckpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlInferenceCheckpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlInferenceCheckpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointOperation.Json.g.cs index 662129a4..2fe5478e 100644 --- a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointOperation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointOperation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlInferenceCheckpointOperation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlInferenceCheckpointOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlInferenceCheckpointOperation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointRegistration.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointRegistration.Json.g.cs index d73afe57..27e67af8 100644 --- a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointRegistration.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointRegistration.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlInferenceCheckpointRegistration; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlInferenceCheckpointRegistration? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlInferenceCheckpointRegistration; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointResult.Json.g.cs index 5430ec40..4eb938a6 100644 --- a/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlInferenceCheckpointResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlInferenceCheckpointResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlInferenceCheckpointResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlInferenceCheckpointResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlInputChunk.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlInputChunk.Json.g.cs index 802a9485..61d43172 100644 --- a/src/libs/Together/Generated/Together.Models.RlInputChunk.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlInputChunk.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlInputChunk; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlInputChunk? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlInputChunk; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlListMeta.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlListMeta.Json.g.cs index 2c3bba15..388e431c 100644 --- a/src/libs/Together/Generated/Together.Models.RlListMeta.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlListMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlListMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlListMeta? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlListMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLoraConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLoraConfig.Json.g.cs index c56ac7e1..1a82376d 100644 --- a/src/libs/Together/Generated/Together.Models.RlLoraConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLoraConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLoraConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLoraConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLoraConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLoraConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlLoraConfig.g.cs index 6c801588..85dabbf0 100644 --- a/src/libs/Together/Generated/Together.Models.RlLoraConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLoraConfig.g.cs @@ -10,30 +10,30 @@ public sealed partial class RlLoraConfig { /// /// Rank of the LoRA adapter
- /// Default Value: 8
- /// Example: 8 + /// Default Value: 32
+ /// Example: 32 ///
- /// 8 + /// 32 [global::System.Text.Json.Serialization.JsonPropertyName("rank")] - public long? Rank { get; set; } + public int? Rank { get; set; } /// /// Alpha of the LoRA adapter
- /// Default Value: 16
- /// Example: 16 + /// Default Value: 64
+ /// Example: 64 ///
- /// 16 + /// 64 [global::System.Text.Json.Serialization.JsonPropertyName("alpha")] - public long? Alpha { get; set; } + public int? Alpha { get; set; } /// /// Dropout of the LoRA adapter
- /// Default Value: 0.05
- /// Example: 0.05 + /// Default Value: 0.0
+ /// Example: 0 ///
- /// 0.05 + /// 0 [global::System.Text.Json.Serialization.JsonPropertyName("dropout")] - public float? Dropout { get; set; } + public double? Dropout { get; set; } /// /// Whether to enable LoRA fine-tuning. If false, full fine-tuning is used.
@@ -55,18 +55,18 @@ public sealed partial class RlLoraConfig ///
/// /// Rank of the LoRA adapter
- /// Default Value: 8
- /// Example: 8 + /// Default Value: 32
+ /// Example: 32 /// /// /// Alpha of the LoRA adapter
- /// Default Value: 16
- /// Example: 16 + /// Default Value: 64
+ /// Example: 64 /// /// /// Dropout of the LoRA adapter
- /// Default Value: 0.05
- /// Example: 0.05 + /// Default Value: 0.0
+ /// Example: 0 /// /// /// Whether to enable LoRA fine-tuning. If false, full fine-tuning is used.
@@ -77,9 +77,9 @@ public sealed partial class RlLoraConfig [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlLoraConfig( - long? rank, - long? alpha, - float? dropout, + int? rank, + int? alpha, + double? dropout, bool? enable) { this.Rank = rank; diff --git a/src/libs/Together/Generated/Together.Models.RlLossAdvantages.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossAdvantages.Json.g.cs index c4e216d4..c17ee2eb 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossAdvantages.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossAdvantages.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossAdvantages; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossAdvantages? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossAdvantages; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossAdvantages.g.cs b/src/libs/Together/Generated/Together.Models.RlLossAdvantages.g.cs index 8294e6d9..9843981b 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossAdvantages.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossAdvantages.g.cs @@ -15,7 +15,7 @@ public sealed partial class RlLossAdvantages /// [0.5, 0.5] [global::System.Text.Json.Serialization.JsonPropertyName("data")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } + public required global::System.Collections.Generic.IList Data { get; set; } /// /// Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
@@ -46,7 +46,7 @@ public sealed partial class RlLossAdvantages [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlLossAdvantages( - global::System.Collections.Generic.IList data, + global::System.Collections.Generic.IList data, global::Together.RlDType? dtype) { this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); diff --git a/src/libs/Together/Generated/Together.Models.RlLossConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossConfig.Json.g.cs index a4491b9e..d1026d52 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossConfig.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlLossConfig.g.cs index ec88d968..af4bae26 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossConfig.g.cs @@ -30,6 +30,24 @@ public sealed partial class RlLossConfig [global::System.Text.Json.Serialization.JsonPropertyName("grpo_params")] public global::Together.RlGRPOLossParams? GrpoParams { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ppo_params")] + public global::Together.RlPPOLossParams? PpoParams { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cispo_params")] + public global::Together.RlCispoLossParams? CispoParams { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dro_params")] + public global::Together.RlDroLossParams? DroParams { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -47,17 +65,26 @@ public sealed partial class RlLossConfig /// Cross-entropy loss parameters (currently empty). /// /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlLossConfig( global::Together.RlLossType type, global::Together.RlCrossEntropyLossParams? crossEntropyParams, - global::Together.RlGRPOLossParams? grpoParams) + global::Together.RlGRPOLossParams? grpoParams, + global::Together.RlPPOLossParams? ppoParams, + global::Together.RlCispoLossParams? cispoParams, + global::Together.RlDroLossParams? droParams) { this.Type = type; this.CrossEntropyParams = crossEntropyParams; this.GrpoParams = grpoParams; + this.PpoParams = ppoParams; + this.CispoParams = cispoParams; + this.DroParams = droParams; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossInputs.Json.g.cs index 646de068..c0061267 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossInputs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossInputs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossInputs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossInputs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossInputs.g.cs b/src/libs/Together/Generated/Together.Models.RlLossInputs.g.cs index 3489d834..01e47daf 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossInputs.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossInputs.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// + /// Token-level inputs used to compute the loss for one training sample. /// public sealed partial class RlLossInputs { @@ -16,17 +16,41 @@ public sealed partial class RlLossInputs public required global::Together.RlLossTargetTokens TargetTokens { get; set; } /// - /// Per-token loss mask (1=compute loss, 0=ignore) + /// Per-token loss mask (1=compute loss, 0=ignore). Required for cross-entropy forward-backward; optional for forward and advantage-based losses, where omission includes all tokens. /// [global::System.Text.Json.Serialization.JsonPropertyName("loss_mask")] public global::Together.RlLossMask? LossMask { get; set; } /// - /// + /// Inputs required when the loss type is GRPO /// [global::System.Text.Json.Serialization.JsonPropertyName("grpo_inputs")] public global::Together.RlGRPOLossInputs? GrpoInputs { get; set; } + /// + /// Inputs required when the loss type is importance sampling + /// + [global::System.Text.Json.Serialization.JsonPropertyName("importance_sampling_inputs")] + public global::Together.RlImportanceSamplingLossInputs? ImportanceSamplingInputs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ppo_inputs")] + public global::Together.RlPPOLossInputs? PpoInputs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cispo_inputs")] + public global::Together.RlCispoLossInputs? CispoInputs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dro_inputs")] + public global::Together.RlDroLossInputs? DroInputs { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -40,20 +64,36 @@ public sealed partial class RlLossInputs /// Target tokens for loss computation /// /// - /// Per-token loss mask (1=compute loss, 0=ignore) + /// Per-token loss mask (1=compute loss, 0=ignore). Required for cross-entropy forward-backward; optional for forward and advantage-based losses, where omission includes all tokens. + /// + /// + /// Inputs required when the loss type is GRPO + /// + /// + /// Inputs required when the loss type is importance sampling /// - /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlLossInputs( global::Together.RlLossTargetTokens targetTokens, global::Together.RlLossMask? lossMask, - global::Together.RlGRPOLossInputs? grpoInputs) + global::Together.RlGRPOLossInputs? grpoInputs, + global::Together.RlImportanceSamplingLossInputs? importanceSamplingInputs, + global::Together.RlPPOLossInputs? ppoInputs, + global::Together.RlCispoLossInputs? cispoInputs, + global::Together.RlDroLossInputs? droInputs) { this.TargetTokens = targetTokens ?? throw new global::System.ArgumentNullException(nameof(targetTokens)); this.LossMask = lossMask; this.GrpoInputs = grpoInputs; + this.ImportanceSamplingInputs = importanceSamplingInputs; + this.PpoInputs = ppoInputs; + this.CispoInputs = cispoInputs; + this.DroInputs = droInputs; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlLossLogprobs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossLogprobs.Json.g.cs index f910b58a..e68725f5 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossLogprobs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossLogprobs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossLogprobs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossLogprobs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossLogprobs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossLogprobs.g.cs b/src/libs/Together/Generated/Together.Models.RlLossLogprobs.g.cs index 8e98de67..56b1ad0e 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossLogprobs.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossLogprobs.g.cs @@ -15,7 +15,7 @@ public sealed partial class RlLossLogprobs /// [-1.2, -0.8] [global::System.Text.Json.Serialization.JsonPropertyName("data")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } + public required global::System.Collections.Generic.IList Data { get; set; } /// /// Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
@@ -46,7 +46,7 @@ public sealed partial class RlLossLogprobs [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlLossLogprobs( - global::System.Collections.Generic.IList data, + global::System.Collections.Generic.IList data, global::Together.RlDType? dtype) { this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); diff --git a/src/libs/Together/Generated/Together.Models.RlLossMask.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossMask.Json.g.cs index ec1f118c..bbc9fd76 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossMask.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossMask.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossMask; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossMask? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossMask; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossTargetTokens.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlLossTargetTokens.Json.g.cs index f7dd707d..9e72939d 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossTargetTokens.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossTargetTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlLossTargetTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlLossTargetTokens? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlLossTargetTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlLossType.g.cs b/src/libs/Together/Generated/Together.Models.RlLossType.g.cs index 1d1d1fef..89e94a1b 100644 --- a/src/libs/Together/Generated/Together.Models.RlLossType.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlLossType.g.cs @@ -4,10 +4,15 @@ namespace Together { /// + /// Type of loss function used for RL training.
/// Default Value: LOSS_TYPE_UNSPECIFIED ///
public enum RlLossType { + /// + /// + /// + LossTypeCispo, /// /// /// @@ -15,10 +20,22 @@ public enum RlLossType /// /// /// + LossTypeDro, + /// + /// + /// LossTypeGrpo, /// /// /// + LossTypeImportanceSampling, + /// + /// + /// + LossTypePpo, + /// + /// + /// LossTypeUnspecified, } @@ -34,8 +51,12 @@ public static string ToValueString(this RlLossType value) { return value switch { + RlLossType.LossTypeCispo => "LOSS_TYPE_CISPO", RlLossType.LossTypeCrossEntropy => "LOSS_TYPE_CROSS_ENTROPY", + RlLossType.LossTypeDro => "LOSS_TYPE_DRO", RlLossType.LossTypeGrpo => "LOSS_TYPE_GRPO", + RlLossType.LossTypeImportanceSampling => "LOSS_TYPE_IMPORTANCE_SAMPLING", + RlLossType.LossTypePpo => "LOSS_TYPE_PPO", RlLossType.LossTypeUnspecified => "LOSS_TYPE_UNSPECIFIED", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; @@ -47,8 +68,12 @@ public static string ToValueString(this RlLossType value) { return value switch { + "LOSS_TYPE_CISPO" => RlLossType.LossTypeCispo, "LOSS_TYPE_CROSS_ENTROPY" => RlLossType.LossTypeCrossEntropy, + "LOSS_TYPE_DRO" => RlLossType.LossTypeDro, "LOSS_TYPE_GRPO" => RlLossType.LossTypeGrpo, + "LOSS_TYPE_IMPORTANCE_SAMPLING" => RlLossType.LossTypeImportanceSampling, + "LOSS_TYPE_PPO" => RlLossType.LossTypePpo, "LOSS_TYPE_UNSPECIFIED" => RlLossType.LossTypeUnspecified, _ => null, }; diff --git a/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.Json.g.cs new file mode 100644 index 00000000..5927bfca --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelFullModeConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelFullModeConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelFullModeConfig), + jsonSerializerContext) as global::Together.RlModelFullModeConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelFullModeConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelFullModeConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelFullModeConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelFullModeConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.g.cs new file mode 100644 index 00000000..d1402e36 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelFullModeConfig.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace Together +{ + /// + /// Full-weight training config. If present, the model supports full-weight training. + /// + public sealed partial class RlModelFullModeConfig + { + /// + /// Maximum global batch size accepted by a forward-backward step
+ /// Example: 512 + ///
+ /// 512 + [global::System.Text.Json.Serialization.JsonPropertyName("max_batch_size")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxBatchSize { get; set; } + + /// + /// Maximum sequence length in tokens
+ /// Example: 40960 + ///
+ /// 40960 + [global::System.Text.Json.Serialization.JsonPropertyName("max_seq_length")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxSeqLength { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Maximum global batch size accepted by a forward-backward step
+ /// Example: 512 + /// + /// + /// Maximum sequence length in tokens
+ /// Example: 40960 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelFullModeConfig( + int maxBatchSize, + int maxSeqLength) + { + this.MaxBatchSize = maxBatchSize; + this.MaxSeqLength = maxSeqLength; + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelFullModeConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.Json.g.cs new file mode 100644 index 00000000..b3deb0a4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelGeneratorConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelGeneratorConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelGeneratorConfig), + jsonSerializerContext) as global::Together.RlModelGeneratorConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelGeneratorConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelGeneratorConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelGeneratorConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelGeneratorConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.g.cs new file mode 100644 index 00000000..ace0c6b2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelGeneratorConfig.g.cs @@ -0,0 +1,62 @@ + +#nullable enable + +namespace Together +{ + /// + /// Inference config. If present, the model can be provisioned with one or more generator replicas. + /// + public sealed partial class RlModelGeneratorConfig + { + /// + /// Maximum tokens in a single inference request (prompt + completion)
+ /// Example: 40960 + ///
+ /// 40960 + [global::System.Text.Json.Serialization.JsonPropertyName("context_length")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int ContextLength { get; set; } + + /// + /// Default sampling parameters used for sample requests. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sampling_defaults")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlModelSamplingDefaults SamplingDefaults { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Maximum tokens in a single inference request (prompt + completion)
+ /// Example: 40960 + /// + /// + /// Default sampling parameters used for sample requests. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelGeneratorConfig( + int contextLength, + global::Together.RlModelSamplingDefaults samplingDefaults) + { + this.ContextLength = contextLength; + this.SamplingDefaults = samplingDefaults ?? throw new global::System.ArgumentNullException(nameof(samplingDefaults)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelGeneratorConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelInput.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelInput.Json.g.cs index 101d06ac..322a278e 100644 --- a/src/libs/Together/Generated/Together.Models.RlModelInput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlModelInput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlModelInput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelInput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelInput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.Json.g.cs new file mode 100644 index 00000000..f6cf5779 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelLoraModeConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelLoraModeConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelLoraModeConfig), + jsonSerializerContext) as global::Together.RlModelLoraModeConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelLoraModeConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelLoraModeConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelLoraModeConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelLoraModeConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.g.cs new file mode 100644 index 00000000..9fcd0a23 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelLoraModeConfig.g.cs @@ -0,0 +1,80 @@ + +#nullable enable + +namespace Together +{ + /// + /// LoRA training config. If present, the model supports LoRA training. + /// + public sealed partial class RlModelLoraModeConfig + { + /// + /// Maximum global batch size accepted by a forward-backward step
+ /// Example: 512 + ///
+ /// 512 + [global::System.Text.Json.Serialization.JsonPropertyName("max_batch_size")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxBatchSize { get; set; } + + /// + /// Maximum sequence length in tokens
+ /// Example: 40960 + ///
+ /// 40960 + [global::System.Text.Json.Serialization.JsonPropertyName("max_seq_length")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxSeqLength { get; set; } + + /// + /// Maximum LoRA rank
+ /// Example: 64 + ///
+ /// 64 + [global::System.Text.Json.Serialization.JsonPropertyName("max_rank")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxRank { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Maximum global batch size accepted by a forward-backward step
+ /// Example: 512 + /// + /// + /// Maximum sequence length in tokens
+ /// Example: 40960 + /// + /// + /// Maximum LoRA rank
+ /// Example: 64 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelLoraModeConfig( + int maxBatchSize, + int maxSeqLength, + int maxRank) + { + this.MaxBatchSize = maxBatchSize; + this.MaxSeqLength = maxSeqLength; + this.MaxRank = maxRank; + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelLoraModeConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResources.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResources.Json.g.cs new file mode 100644 index 00000000..e9cd683f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResources.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelResources + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelResources? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelResources), + jsonSerializerContext) as global::Together.RlModelResources; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelResources? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelResources? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelResources), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelResources; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs new file mode 100644 index 00000000..1ac4ddb1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs @@ -0,0 +1,173 @@ + +#nullable enable + +namespace Together +{ + /// + /// Allocated GPU resources that training sessions attach to + /// + public sealed partial class RlModelResources + { + /// + /// Unique identifier for the model resource
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 + ///
+ /// 123e4567-e89b-12d3-a456-426614174000 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Lifecycle status of the model resource + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlModelResourcesStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlModelResourcesStatus Status { get; set; } + + /// + /// Structured detail for the model resource's current error. Set when the resource is in an error state. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Together.RlModelResourcesError? Error { get; set; } + + /// + /// Base model the resource is provisioned for
+ /// Example: Qwen/Qwen3-0.6B + ///
+ /// Qwen/Qwen3-0.6B + [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModel { get; set; } + + /// + /// Compute layout provisioned for the resource. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("compute_config")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlComputeConfig ComputeConfig { get; set; } + + /// + /// Whether the resource hosts LoRA sessions or a full-weight session
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("lora_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool LoraEnabled { get; set; } + + /// + /// Timestamp when the model resource was created
+ /// Example: 2026-01-02T00:00:00Z + ///
+ /// 2026-01-02T00:00:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Timestamp when the model resource was last updated
+ /// Example: 2026-01-02T00:00:05Z + ///
+ /// 2026-01-02T00:00:05Z + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Optimizer configuration for this resource. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("optimizer_config")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlOptimizerConfig OptimizerConfig { get; set; } + + /// + /// ID of the user who created the model resource
+ /// Example: user_123 + ///
+ /// user_123 + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedBy { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the model resource
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 + /// + /// + /// Lifecycle status of the model resource + /// + /// + /// Base model the resource is provisioned for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout provisioned for the resource. + /// + /// + /// Whether the resource hosts LoRA sessions or a full-weight session
+ /// Example: true + /// + /// + /// Timestamp when the model resource was created
+ /// Example: 2026-01-02T00:00:00Z + /// + /// + /// Timestamp when the model resource was last updated
+ /// Example: 2026-01-02T00:00:05Z + /// + /// + /// Optimizer configuration for this resource. + /// + /// + /// ID of the user who created the model resource
+ /// Example: user_123 + /// + /// + /// Structured detail for the model resource's current error. Set when the resource is in an error state. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelResources( + string id, + global::Together.RlModelResourcesStatus status, + string baseModel, + global::Together.RlComputeConfig computeConfig, + bool loraEnabled, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + global::Together.RlOptimizerConfig optimizerConfig, + string createdBy, + global::Together.RlModelResourcesError? error) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Status = status; + this.Error = error; + this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); + this.ComputeConfig = computeConfig ?? throw new global::System.ArgumentNullException(nameof(computeConfig)); + this.LoraEnabled = loraEnabled; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.OptimizerConfig = optimizerConfig ?? throw new global::System.ArgumentNullException(nameof(optimizerConfig)); + this.CreatedBy = createdBy ?? throw new global::System.ArgumentNullException(nameof(createdBy)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelResources() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesError.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesError.Json.g.cs new file mode 100644 index 00000000..e9257799 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelResourcesError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelResourcesError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelResourcesError), + jsonSerializerContext) as global::Together.RlModelResourcesError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelResourcesError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelResourcesError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelResourcesError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelResourcesError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesError.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesError.g.cs new file mode 100644 index 00000000..3cd2ab39 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesError.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Together +{ + /// + /// Structured detail for the model resource's current error + /// + public sealed partial class RlModelResourcesError + { + /// + /// Finite machine-readable reason code for UI branching + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlModelResourcesErrorCode Code { get; set; } + + /// + /// User-safe human-readable detail for the current status
+ /// Example: Capacity is currently unavailable. Try again later. + ///
+ /// Capacity is currently unavailable. Try again later. + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Timestamp when this error was reported
+ /// Example: 2026-01-02T00:00:05Z + ///
+ /// 2026-01-02T00:00:05Z + [global::System.Text.Json.Serialization.JsonPropertyName("occurred_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime OccurredAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Finite machine-readable reason code for UI branching + /// + /// + /// User-safe human-readable detail for the current status
+ /// Example: Capacity is currently unavailable. Try again later. + /// + /// + /// Timestamp when this error was reported
+ /// Example: 2026-01-02T00:00:05Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelResourcesError( + global::Together.RlModelResourcesErrorCode code, + string message, + global::System.DateTime occurredAt) + { + this.Code = code; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.OccurredAt = occurredAt; + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelResourcesError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesErrorCode.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesErrorCode.g.cs new file mode 100644 index 00000000..a9a7e108 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesErrorCode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Finite machine-readable model resource lifecycle error code + /// + public enum RlModelResourcesErrorCode + { + /// + /// + /// + ModelResourcesErrorCodeCapacityUnavailable, + /// + /// + /// + ModelResourcesErrorCodeProvisioningFailed, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlModelResourcesErrorCodeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlModelResourcesErrorCode value) + { + return value switch + { + RlModelResourcesErrorCode.ModelResourcesErrorCodeCapacityUnavailable => "MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE", + RlModelResourcesErrorCode.ModelResourcesErrorCodeProvisioningFailed => "MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlModelResourcesErrorCode? ToEnum(string value) + { + return value switch + { + "MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE" => RlModelResourcesErrorCode.ModelResourcesErrorCodeCapacityUnavailable, + "MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED" => RlModelResourcesErrorCode.ModelResourcesErrorCodeProvisioningFailed, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.Json.g.cs new file mode 100644 index 00000000..0d31513d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelResourcesEstimateCostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelResourcesEstimateCostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelResourcesEstimateCostResponse), + jsonSerializerContext) as global::Together.RlModelResourcesEstimateCostResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelResourcesEstimateCostResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelResourcesEstimateCostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelResourcesEstimateCostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelResourcesEstimateCostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.g.cs new file mode 100644 index 00000000..30d0e05e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesEstimateCostResponse.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlModelResourcesEstimateCostResponse + { + /// + /// Estimated on-demand price per hour in the currency's major unit.
+ /// Example: 56 + ///
+ /// 56 + [global::System.Text.Json.Serialization.JsonPropertyName("price_per_hour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double PricePerHour { get; set; } + + /// + /// ISO 4217 currency code.
+ /// Example: USD + ///
+ /// USD + [global::System.Text.Json.Serialization.JsonPropertyName("currency")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Currency { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Estimated on-demand price per hour in the currency's major unit.
+ /// Example: 56 + /// + /// + /// ISO 4217 currency code.
+ /// Example: USD + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelResourcesEstimateCostResponse( + double pricePerHour, + string currency) + { + this.PricePerHour = pricePerHour; + this.Currency = currency ?? throw new global::System.ArgumentNullException(nameof(currency)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelResourcesEstimateCostResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.Json.g.cs new file mode 100644 index 00000000..381d1a42 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelResourcesListResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelResourcesListResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelResourcesListResponse), + jsonSerializerContext) as global::Together.RlModelResourcesListResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelResourcesListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelResourcesListResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelResourcesListResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelResourcesListResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.g.cs new file mode 100644 index 00000000..3a023716 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesListResponse.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Paginated list of model resources + /// + public sealed partial class RlModelResourcesListResponse + { + /// + /// List of model resources + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Pagination metadata + /// + [global::System.Text.Json.Serialization.JsonPropertyName("meta")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlListMeta Meta { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// List of model resources + /// + /// + /// Pagination metadata + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelResourcesListResponse( + global::System.Collections.Generic.IList data, + global::Together.RlListMeta meta) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Meta = meta ?? throw new global::System.ArgumentNullException(nameof(meta)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelResourcesListResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesStatus.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesStatus.g.cs new file mode 100644 index 00000000..c54c11d9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelResourcesStatus.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Together +{ + /// + /// Lifecycle status of a model resource + /// + public enum RlModelResourcesStatus + { + /// + /// + /// + ModelResourcesStatusCreating, + /// + /// + /// + ModelResourcesStatusError, + /// + /// + /// + ModelResourcesStatusPending, + /// + /// + /// + ModelResourcesStatusReady, + /// + /// + /// + ModelResourcesStatusStopped, + /// + /// + /// + ModelResourcesStatusStopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlModelResourcesStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlModelResourcesStatus value) + { + return value switch + { + RlModelResourcesStatus.ModelResourcesStatusCreating => "MODEL_RESOURCES_STATUS_CREATING", + RlModelResourcesStatus.ModelResourcesStatusError => "MODEL_RESOURCES_STATUS_ERROR", + RlModelResourcesStatus.ModelResourcesStatusPending => "MODEL_RESOURCES_STATUS_PENDING", + RlModelResourcesStatus.ModelResourcesStatusReady => "MODEL_RESOURCES_STATUS_READY", + RlModelResourcesStatus.ModelResourcesStatusStopped => "MODEL_RESOURCES_STATUS_STOPPED", + RlModelResourcesStatus.ModelResourcesStatusStopping => "MODEL_RESOURCES_STATUS_STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlModelResourcesStatus? ToEnum(string value) + { + return value switch + { + "MODEL_RESOURCES_STATUS_CREATING" => RlModelResourcesStatus.ModelResourcesStatusCreating, + "MODEL_RESOURCES_STATUS_ERROR" => RlModelResourcesStatus.ModelResourcesStatusError, + "MODEL_RESOURCES_STATUS_PENDING" => RlModelResourcesStatus.ModelResourcesStatusPending, + "MODEL_RESOURCES_STATUS_READY" => RlModelResourcesStatus.ModelResourcesStatusReady, + "MODEL_RESOURCES_STATUS_STOPPED" => RlModelResourcesStatus.ModelResourcesStatusStopped, + "MODEL_RESOURCES_STATUS_STOPPING" => RlModelResourcesStatus.ModelResourcesStatusStopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.Json.g.cs new file mode 100644 index 00000000..e47a51b8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelSamplingDefaults + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelSamplingDefaults? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelSamplingDefaults), + jsonSerializerContext) as global::Together.RlModelSamplingDefaults; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelSamplingDefaults? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelSamplingDefaults? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelSamplingDefaults), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelSamplingDefaults; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.g.cs b/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.g.cs new file mode 100644 index 00000000..a4e3c778 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelSamplingDefaults.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace Together +{ + /// + /// Default sampling parameters used for a Sample request. + /// + public sealed partial class RlModelSamplingDefaults + { + /// + /// Number of completions per prompt
+ /// Example: 1 + ///
+ /// 1 + [global::System.Text.Json.Serialization.JsonPropertyName("n")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int N { get; set; } + + /// + /// Maximum tokens generated per completion
+ /// Example: 512 + ///
+ /// 512 + [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxTokens { get; set; } + + /// + /// Sampling temperature
+ /// Example: 1 + ///
+ /// 1 + [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Temperature { get; set; } + + /// + /// Number of logprobs to return per token
+ /// Example: 1 + ///
+ /// 1 + [global::System.Text.Json.Serialization.JsonPropertyName("logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Logprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of completions per prompt
+ /// Example: 1 + /// + /// + /// Maximum tokens generated per completion
+ /// Example: 512 + /// + /// + /// Sampling temperature
+ /// Example: 1 + /// + /// + /// Number of logprobs to return per token
+ /// Example: 1 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelSamplingDefaults( + int n, + int maxTokens, + double temperature, + int logprobs) + { + this.N = n; + this.MaxTokens = maxTokens; + this.Temperature = temperature; + this.Logprobs = logprobs; + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelSamplingDefaults() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.Json.g.cs new file mode 100644 index 00000000..42871c11 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlModelTrainerConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlModelTrainerConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlModelTrainerConfig), + jsonSerializerContext) as global::Together.RlModelTrainerConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlModelTrainerConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlModelTrainerConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlModelTrainerConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelTrainerConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.g.cs new file mode 100644 index 00000000..c94c0af8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlModelTrainerConfig.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Training config. Each sub-mode is present only when the model supports that training mode. + /// + public sealed partial class RlModelTrainerConfig + { + /// + /// Full-weight training config. Set when the model supports full-weight training. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("full")] + public global::Together.RlModelFullModeConfig? Full { get; set; } + + /// + /// LoRA training config. Set when the model supports LoRA training. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("lora")] + public global::Together.RlModelLoraModeConfig? Lora { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Full-weight training config. Set when the model supports full-weight training. + /// + /// + /// LoRA training config. Set when the model supports LoRA training. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlModelTrainerConfig( + global::Together.RlModelFullModeConfig? full, + global::Together.RlModelLoraModeConfig? lora) + { + this.Full = full; + this.Lora = lora; + } + + /// + /// Initializes a new instance of the class. + /// + public RlModelTrainerConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.Json.g.cs new file mode 100644 index 00000000..897b92a4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlMuonOptimizerConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlMuonOptimizerConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlMuonOptimizerConfig), + jsonSerializerContext) as global::Together.RlMuonOptimizerConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlMuonOptimizerConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlMuonOptimizerConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlMuonOptimizerConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlMuonOptimizerConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.g.cs new file mode 100644 index 00000000..e3209ee7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerConfig.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace Together +{ + /// + /// Advanced configuration for the Muon optimizer. + /// + public sealed partial class RlMuonOptimizerConfig + { + /// + /// Scaling strategy for the Muon optimizer.
+ /// Default Value: MUON_SCALING_STRATEGY_MATCH_ADAMW + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("scaling_strategy")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter))] + public global::Together.RlMuonScalingStrategy? ScalingStrategy { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Scaling strategy for the Muon optimizer.
+ /// Default Value: MUON_SCALING_STRATEGY_MATCH_ADAMW + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlMuonOptimizerConfig( + global::Together.RlMuonScalingStrategy? scalingStrategy) + { + this.ScalingStrategy = scalingStrategy; + } + + /// + /// Initializes a new instance of the class. + /// + public RlMuonOptimizerConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.Json.g.cs new file mode 100644 index 00000000..9da531c4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlMuonOptimizerParams + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlMuonOptimizerParams? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlMuonOptimizerParams), + jsonSerializerContext) as global::Together.RlMuonOptimizerParams; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlMuonOptimizerParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlMuonOptimizerParams? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlMuonOptimizerParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlMuonOptimizerParams; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.g.cs b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.g.cs new file mode 100644 index 00000000..94dbc5d8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlMuonOptimizerParams.g.cs @@ -0,0 +1,108 @@ + +#nullable enable + +namespace Together +{ + /// + /// Per-step Muon optimizer overrides + /// + public sealed partial class RlMuonOptimizerParams + { + /// + /// Learning rate for this Muon optimizer step.
+ /// Example: 0.02 + ///
+ /// 0.02 + [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] + public double? LearningRate { get; set; } + + /// + /// Momentum coefficient
+ /// Default Value: 0.95
+ /// Example: 0.95 + ///
+ /// 0.95 + [global::System.Text.Json.Serialization.JsonPropertyName("momentum")] + public double? Momentum { get; set; } + + /// + /// Number of Newton-Schulz iterations
+ /// Default Value: 5
+ /// Example: 5 + ///
+ /// 5 + [global::System.Text.Json.Serialization.JsonPropertyName("newton_schulz_steps")] + public int? NewtonSchulzSteps { get; set; } + + /// + /// Weight decay coefficient
+ /// Default Value: 0.0
+ /// Example: 0 + ///
+ /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("weight_decay")] + public double? WeightDecay { get; set; } + + /// + /// Per-step AdamW optimizer overrides for the AdamW-tuned parameters in a Muon-tuned optimizer session. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adamw")] + public global::Together.RlAdamWOptimizerParams? Adamw { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Learning rate for this Muon optimizer step.
+ /// Example: 0.02 + /// + /// + /// Momentum coefficient
+ /// Default Value: 0.95
+ /// Example: 0.95 + /// + /// + /// Number of Newton-Schulz iterations
+ /// Default Value: 5
+ /// Example: 5 + /// + /// + /// Weight decay coefficient
+ /// Default Value: 0.0
+ /// Example: 0 + /// + /// + /// Per-step AdamW optimizer overrides for the AdamW-tuned parameters in a Muon-tuned optimizer session. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlMuonOptimizerParams( + double? learningRate, + double? momentum, + int? newtonSchulzSteps, + double? weightDecay, + global::Together.RlAdamWOptimizerParams? adamw) + { + this.LearningRate = learningRate; + this.Momentum = momentum; + this.NewtonSchulzSteps = newtonSchulzSteps; + this.WeightDecay = weightDecay; + this.Adamw = adamw; + } + + /// + /// Initializes a new instance of the class. + /// + public RlMuonOptimizerParams() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlMuonScalingStrategy.g.cs b/src/libs/Together/Generated/Together.Models.RlMuonScalingStrategy.g.cs new file mode 100644 index 00000000..c5710167 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlMuonScalingStrategy.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Default Value: MUON_SCALING_STRATEGY_UNSPECIFIED + /// + public enum RlMuonScalingStrategy + { + /// + /// + /// + MuonScalingStrategyMatchAdamw, + /// + /// + /// + MuonScalingStrategyOriginal, + /// + /// + /// + MuonScalingStrategyUnspecified, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlMuonScalingStrategyExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlMuonScalingStrategy value) + { + return value switch + { + RlMuonScalingStrategy.MuonScalingStrategyMatchAdamw => "MUON_SCALING_STRATEGY_MATCH_ADAMW", + RlMuonScalingStrategy.MuonScalingStrategyOriginal => "MUON_SCALING_STRATEGY_ORIGINAL", + RlMuonScalingStrategy.MuonScalingStrategyUnspecified => "MUON_SCALING_STRATEGY_UNSPECIFIED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlMuonScalingStrategy? ToEnum(string value) + { + return value switch + { + "MUON_SCALING_STRATEGY_MATCH_ADAMW" => RlMuonScalingStrategy.MuonScalingStrategyMatchAdamw, + "MUON_SCALING_STRATEGY_ORIGINAL" => RlMuonScalingStrategy.MuonScalingStrategyOriginal, + "MUON_SCALING_STRATEGY_UNSPECIFIED" => RlMuonScalingStrategy.MuonScalingStrategyUnspecified, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlOptimStepBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimStepBody.Json.g.cs index bfc6a3dc..88f4908c 100644 --- a/src/libs/Together/Generated/Together.Models.RlOptimStepBody.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlOptimStepBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlOptimStepBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlOptimStepBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlOptimStepBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlOptimStepBody.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimStepBody.g.cs index a9938cc4..c4400fee 100644 --- a/src/libs/Together/Generated/Together.Models.RlOptimStepBody.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlOptimStepBody.g.cs @@ -9,20 +9,36 @@ namespace Together public sealed partial class RlOptimStepBody { /// - /// Learning rate for this step.
- /// Default Value: 0.0001
- /// Example: 0.0001 + /// How the trainer's updated weights are propagated to the generator after this optimizer step. See `WeightSyncType` for accepted values.
+ /// Default Value: WEIGHT_SYNC_TYPE_UNSPECIFIED ///
- /// 0.0001 - [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public float? LearningRate { get; set; } + /// global::Together.RlWeightSyncType.WeightSyncTypeUnspecified + [global::System.Text.Json.Serialization.JsonPropertyName("weight_sync_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlWeightSyncTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlWeightSyncType WeightSyncType { get; set; } = global::Together.RlWeightSyncType.WeightSyncTypeUnspecified; /// - /// AdamW optimizer parameters + /// Maximum gradient norm for this step, gradients across all model parameters are clipped to this value.
+ /// Default Value: 1.0
+ /// Example: 10 + ///
+ /// 10 + [global::System.Text.Json.Serialization.JsonPropertyName("max_grad_norm")] + public float? MaxGradNorm { get; set; } + + /// + /// Per-step AdamW optimizer overrides. /// [global::System.Text.Json.Serialization.JsonPropertyName("adamw_params")] public global::Together.RlAdamWOptimizerParams? AdamwParams { get; set; } + /// + /// Per-step Muon optimizer overrides + /// + [global::System.Text.Json.Serialization.JsonPropertyName("muon_params")] + public global::Together.RlMuonOptimizerParams? MuonParams { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -32,23 +48,34 @@ public sealed partial class RlOptimStepBody /// /// Initializes a new instance of the class. /// - /// - /// Learning rate for this step.
- /// Default Value: 0.0001
- /// Example: 0.0001 + /// + /// How the trainer's updated weights are propagated to the generator after this optimizer step. See `WeightSyncType` for accepted values.
+ /// Default Value: WEIGHT_SYNC_TYPE_UNSPECIFIED + /// + /// + /// Maximum gradient norm for this step, gradients across all model parameters are clipped to this value.
+ /// Default Value: 1.0
+ /// Example: 10 /// /// - /// AdamW optimizer parameters + /// Per-step AdamW optimizer overrides. + /// + /// + /// Per-step Muon optimizer overrides /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlOptimStepBody( - float? learningRate, - global::Together.RlAdamWOptimizerParams? adamwParams) + global::Together.RlWeightSyncType weightSyncType, + float? maxGradNorm, + global::Together.RlAdamWOptimizerParams? adamwParams, + global::Together.RlMuonOptimizerParams? muonParams) { - this.LearningRate = learningRate; + this.WeightSyncType = weightSyncType; + this.MaxGradNorm = maxGradNorm; this.AdamwParams = adamwParams; + this.MuonParams = muonParams; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlOptimStepOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimStepOperation.Json.g.cs index aad87f32..1a34bb58 100644 --- a/src/libs/Together/Generated/Together.Models.RlOptimStepOperation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlOptimStepOperation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlOptimStepOperation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlOptimStepOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlOptimStepOperation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlOptimStepResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimStepResult.Json.g.cs index fec46270..0b784a47 100644 --- a/src/libs/Together/Generated/Together.Models.RlOptimStepResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlOptimStepResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlOptimStepResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlOptimStepResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlOptimStepResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.Json.g.cs new file mode 100644 index 00000000..7bf88a32 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlOptimizerConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlOptimizerConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlOptimizerConfig), + jsonSerializerContext) as global::Together.RlOptimizerConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlOptimizerConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlOptimizerConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlOptimizerConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlOptimizerConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.g.cs new file mode 100644 index 00000000..dcd96e65 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlOptimizerConfig.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Optimizer configuration + /// + public sealed partial class RlOptimizerConfig + { + /// + /// Use the AdamW optimizer. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adamw")] + public global::Together.RlAdamWOptimizerConfig? Adamw { get; set; } + + /// + /// Use the Muon optimizer. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("muon")] + public global::Together.RlMuonOptimizerConfig? Muon { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Use the AdamW optimizer. + /// + /// + /// Use the Muon optimizer. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlOptimizerConfig( + global::Together.RlAdamWOptimizerConfig? adamw, + global::Together.RlMuonOptimizerConfig? muon) + { + this.Adamw = adamw; + this.Muon = muon; + } + + /// + /// Initializes a new instance of the class. + /// + public RlOptimizerConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.Json.g.cs new file mode 100644 index 00000000..c6d2f2af --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlPPOLossInputs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlPPOLossInputs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlPPOLossInputs), + jsonSerializerContext) as global::Together.RlPPOLossInputs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlPPOLossInputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlPPOLossInputs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlPPOLossInputs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlPPOLossInputs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.g.cs b/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.g.cs new file mode 100644 index 00000000..0606cc76 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPPOLossInputs.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlPPOLossInputs + { + /// + /// Per-token advantages for PPO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("advantages")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossAdvantages Advantages { get; set; } + + /// + /// Generator log probabilities for PPO + /// + [global::System.Text.Json.Serialization.JsonPropertyName("generator_logprobs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlLossLogprobs GeneratorLogprobs { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Per-token advantages for PPO + /// + /// + /// Generator log probabilities for PPO + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlPPOLossInputs( + global::Together.RlLossAdvantages advantages, + global::Together.RlLossLogprobs generatorLogprobs) + { + this.Advantages = advantages ?? throw new global::System.ArgumentNullException(nameof(advantages)); + this.GeneratorLogprobs = generatorLogprobs ?? throw new global::System.ArgumentNullException(nameof(generatorLogprobs)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlPPOLossInputs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlPPOLossParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlPPOLossParams.Json.g.cs new file mode 100644 index 00000000..26357354 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPPOLossParams.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlPPOLossParams + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlPPOLossParams? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlPPOLossParams), + jsonSerializerContext) as global::Together.RlPPOLossParams; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlPPOLossParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlPPOLossParams? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlPPOLossParams), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlPPOLossParams; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlPPOLossParams.g.cs b/src/libs/Together/Generated/Together.Models.RlPPOLossParams.g.cs new file mode 100644 index 00000000..c1e98a1a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPPOLossParams.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RlPPOLossParams + { + /// + /// Lower absolute bound for the importance ratio in the clipped surrogate. Must be <= 1.
+ /// Default Value: 0.8
+ /// Example: 0.8 + ///
+ /// 0.8 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_low_threshold")] + public float? ClipLowThreshold { get; set; } + + /// + /// Upper absolute bound for the importance ratio in the clipped surrogate. Must be >= 1.
+ /// Default Value: 1.2
+ /// Example: 1.2 + ///
+ /// 1.2 + [global::System.Text.Json.Serialization.JsonPropertyName("clip_high_threshold")] + public float? ClipHighThreshold { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Lower absolute bound for the importance ratio in the clipped surrogate. Must be <= 1.
+ /// Default Value: 0.8
+ /// Example: 0.8 + /// + /// + /// Upper absolute bound for the importance ratio in the clipped surrogate. Must be >= 1.
+ /// Default Value: 1.2
+ /// Example: 1.2 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlPPOLossParams( + float? clipLowThreshold, + float? clipHighThreshold) + { + this.ClipLowThreshold = clipLowThreshold; + this.ClipHighThreshold = clipHighThreshold; + } + + /// + /// Initializes a new instance of the class. + /// + public RlPPOLossParams() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.Json.g.cs new file mode 100644 index 00000000..af4ecbae --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlPolicyVersionSegment + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlPolicyVersionSegment? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlPolicyVersionSegment), + jsonSerializerContext) as global::Together.RlPolicyVersionSegment; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlPolicyVersionSegment? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlPolicyVersionSegment? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlPolicyVersionSegment), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlPolicyVersionSegment; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.g.cs b/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.g.cs new file mode 100644 index 00000000..9f7e8d06 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlPolicyVersionSegment.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace Together +{ + /// + /// A (policy version, starting token) span within a rollout. Version 0 is the initial model; each optim_step call increments the version by 1. + /// + public sealed partial class RlPolicyVersionSegment + { + /// + /// Model version under which this segment of tokens was generated
+ /// Example: 5 + ///
+ /// 5 + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Version { get; set; } + + /// + /// Index of the first token of this segment within the rollout's token sequence. Always 0 for the first segment.
+ /// Example: 0 + ///
+ /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("start_token")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int StartToken { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Model version under which this segment of tokens was generated
+ /// Example: 5 + /// + /// + /// Index of the first token of this segment within the rollout's token sequence. Always 0 for the first segment.
+ /// Example: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlPolicyVersionSegment( + int version, + int startToken) + { + this.Version = version; + this.StartToken = startToken; + } + + /// + /// Initializes a new instance of the class. + /// + public RlPolicyVersionSegment() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlSampleBody.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleBody.Json.g.cs index 1e059566..ad63ee79 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleBody.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSampleBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSampleBody? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSampleBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSampleBody.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleBody.g.cs index 4e05033d..ddfe5546 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleBody.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleBody.g.cs @@ -28,7 +28,7 @@ public sealed partial class RlSampleBody ///
/// 1 [global::System.Text.Json.Serialization.JsonPropertyName("num_samples")] - public long? NumSamples { get; set; } + public int? NumSamples { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -56,7 +56,7 @@ public sealed partial class RlSampleBody public RlSampleBody( global::System.Collections.Generic.IList prompts, global::Together.RlSamplingParams? samplingParams, - long? numSamples) + int? numSamples) { this.Prompts = prompts ?? throw new global::System.ArgumentNullException(nameof(prompts)); this.SamplingParams = samplingParams; diff --git a/src/libs/Together/Generated/Together.Models.RlSampleOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleOperation.Json.g.cs index e4585356..68c1eb18 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleOperation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleOperation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSampleOperation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSampleOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSampleOperation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSampleResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleResult.Json.g.cs index 453f7a6e..e5ddf0c9 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSampleResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSampleResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSampleResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSampleResult.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleResult.g.cs index 0fe56a8d..07d629df 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleResult.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleResult.g.cs @@ -15,6 +15,12 @@ public sealed partial class RlSampleResult [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Rollouts { get; set; } + /// + /// Policy versions that produced the returned rollouts. Most rollouts carry a single segment `(version, start_token=0)`; longer rollouts may carry multiple segments when the policy was updated mid-generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("policy_segments")] + public global::System.Collections.Generic.IList? PolicySegments { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -27,13 +33,18 @@ public sealed partial class RlSampleResult /// /// Completions grouped by prompt /// + /// + /// Policy versions that produced the returned rollouts. Most rollouts carry a single segment `(version, start_token=0)`; longer rollouts may carry multiple segments when the policy was updated mid-generation. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlSampleResult( - global::System.Collections.Generic.IList rollouts) + global::System.Collections.Generic.IList rollouts, + global::System.Collections.Generic.IList? policySegments) { this.Rollouts = rollouts ?? throw new global::System.ArgumentNullException(nameof(rollouts)); + this.PolicySegments = policySegments; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlSampleRollout.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleRollout.Json.g.cs index c03e1875..f3a39e21 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleRollout.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleRollout.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSampleRollout; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSampleRollout? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSampleRollout; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSampleRollout.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleRollout.g.cs index dbdfa5dc..607e8c77 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleRollout.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleRollout.g.cs @@ -15,6 +15,14 @@ public sealed partial class RlSampleRollout [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Sequences { get; set; } + /// + /// Teacher-forced log-probabilities for the prompt tokens, one per token after the first (log P(token_i | token_<i)). Present only when return_prompt_logprobs was set on the request.
+ /// Example: [-0.5, -1.2, -0.3] + ///
+ /// [-0.5, -1.2, -0.3] + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_logprobs")] + public global::System.Collections.Generic.IList? PromptLogprobs { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -27,13 +35,19 @@ public sealed partial class RlSampleRollout /// /// Completions generated for one prompt /// + /// + /// Teacher-forced log-probabilities for the prompt tokens, one per token after the first (log P(token_i | token_<i)). Present only when return_prompt_logprobs was set on the request.
+ /// Example: [-0.5, -1.2, -0.3] + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlSampleRollout( - global::System.Collections.Generic.IList sequences) + global::System.Collections.Generic.IList sequences, + global::System.Collections.Generic.IList? promptLogprobs) { this.Sequences = sequences ?? throw new global::System.ArgumentNullException(nameof(sequences)); + this.PromptLogprobs = promptLogprobs; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlSampleSequence.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSampleSequence.Json.g.cs index e06de23c..08dc59f8 100644 --- a/src/libs/Together/Generated/Together.Models.RlSampleSequence.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSampleSequence.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSampleSequence; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSampleSequence? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSampleSequence; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSamplingParams.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSamplingParams.Json.g.cs index 306d6236..ae7bef84 100644 --- a/src/libs/Together/Generated/Together.Models.RlSamplingParams.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSamplingParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlSamplingParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSamplingParams? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSamplingParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlSamplingParams.g.cs b/src/libs/Together/Generated/Together.Models.RlSamplingParams.g.cs index b95265fa..6f562dfa 100644 --- a/src/libs/Together/Generated/Together.Models.RlSamplingParams.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSamplingParams.g.cs @@ -10,10 +10,10 @@ public sealed partial class RlSamplingParams { /// /// Maximum number of tokens to generate per completion
- /// Default Value: 100
- /// Example: 100 + /// Default Value: 512
+ /// Example: 512 ///
- /// 100 + /// 512 [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] public int? MaxTokens { get; set; } @@ -24,7 +24,7 @@ public sealed partial class RlSamplingParams ///
/// 1 [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } + public double? Temperature { get; set; } /// /// Nucleus sampling probability threshold
@@ -33,7 +33,7 @@ public sealed partial class RlSamplingParams ///
/// 1 [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] - public float? TopP { get; set; } + public double? TopP { get; set; } /// /// Top-k sampling limit
@@ -61,6 +61,15 @@ public sealed partial class RlSamplingParams [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] public global::Together.OneOf? Seed { get; set; } + /// + /// When true, also return teacher-forced log-probabilities for the prompt tokens in `SampleRollout.prompt_logprobs`.
+ /// Default Value: false
+ /// Example: false + ///
+ /// false + [global::System.Text.Json.Serialization.JsonPropertyName("return_prompt_logprobs")] + public bool? ReturnPromptLogprobs { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -72,8 +81,8 @@ public sealed partial class RlSamplingParams ///
/// /// Maximum number of tokens to generate per completion
- /// Default Value: 100
- /// Example: 100 + /// Default Value: 512
+ /// Example: 512 /// /// /// Sampling temperature
@@ -98,16 +107,22 @@ public sealed partial class RlSamplingParams /// Random seed for reproducibility
/// Example: 42 /// + /// + /// When true, also return teacher-forced log-probabilities for the prompt tokens in `SampleRollout.prompt_logprobs`.
+ /// Default Value: false
+ /// Example: false + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlSamplingParams( int? maxTokens, - float? temperature, - float? topP, + double? temperature, + double? topP, int? topK, global::System.Collections.Generic.IList? stop, - global::Together.OneOf? seed) + global::Together.OneOf? seed, + bool? returnPromptLogprobs) { this.MaxTokens = maxTokens; this.Temperature = temperature; @@ -115,6 +130,7 @@ public RlSamplingParams( this.TopK = topK; this.Stop = stop; this.Seed = seed; + this.ReturnPromptLogprobs = returnPromptLogprobs; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlSessionType.g.cs b/src/libs/Together/Generated/Together.Models.RlSessionType.g.cs deleted file mode 100644 index 14ccfb9a..00000000 --- a/src/libs/Together/Generated/Together.Models.RlSessionType.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// Type of a training session. TRAINER_AND_GENERATOR provisions both trainer and generator; TRAINER_ONLY provisions only the trainer and rejects generator-dependent operations such as sample.
- /// Default Value: SESSION_TYPE_UNSPECIFIED - ///
- public enum RlSessionType - { - /// - /// - /// - SessionTypeTrainerAndGenerator, - /// - /// - /// - SessionTypeTrainerOnly, - /// - /// - /// - SessionTypeUnspecified, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RlSessionTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RlSessionType value) - { - return value switch - { - RlSessionType.SessionTypeTrainerAndGenerator => "SESSION_TYPE_TRAINER_AND_GENERATOR", - RlSessionType.SessionTypeTrainerOnly => "SESSION_TYPE_TRAINER_ONLY", - RlSessionType.SessionTypeUnspecified => "SESSION_TYPE_UNSPECIFIED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RlSessionType? ToEnum(string value) - { - return value switch - { - "SESSION_TYPE_TRAINER_AND_GENERATOR" => RlSessionType.SessionTypeTrainerAndGenerator, - "SESSION_TYPE_TRAINER_ONLY" => RlSessionType.SessionTypeTrainerOnly, - "SESSION_TYPE_UNSPECIFIED" => RlSessionType.SessionTypeUnspecified, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.Json.g.cs index e191d784..fb14e9ca 100644 --- a/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlStartTrainingSessionRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlStartTrainingSessionRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlStartTrainingSessionRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.g.cs b/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.g.cs index 134e179b..0e36fb5e 100644 --- a/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlStartTrainingSessionRequest.g.cs @@ -8,15 +8,6 @@ namespace Together ///
public sealed partial class RlStartTrainingSessionRequest { - /// - /// Base model to use for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct - ///
- /// meta-llama/Meta-Llama-3-8B-Instruct - [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string BaseModel { get; set; } - /// /// Checkpoint ID to resume from
/// Example: 123e4567-e89b-12d3-a456-426614174000 @@ -26,19 +17,28 @@ public sealed partial class RlStartTrainingSessionRequest public string? ResumeFromCheckpointId { get; set; } /// - /// Type of the training session. Defaults to TRAINER_AND_GENERATOR when unspecified. TRAINER_ONLY provisions only the trainer and rejects sample requests.
- /// Default Value: SESSION_TYPE_TRAINER_AND_GENERATOR + /// HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id.
+ /// Example: your-org/llama-3-8b-finetuned ///
- [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlSessionTypeJsonConverter))] - public global::Together.RlSessionType? Type { get; set; } + /// your-org/llama-3-8b-finetuned + [global::System.Text.Json.Serialization.JsonPropertyName("resume_from_hf_checkpoint")] + public string? ResumeFromHfCheckpoint { get; set; } /// - /// LoRA adapter configuration + /// LoRA adapter configuration for the session /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_config")] public global::Together.RlLoraConfig? LoraConfig { get; set; } + /// + /// Model resource to attach the session to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 + ///
+ /// 123e4567-e89b-12d3-a456-426614174000 + [global::System.Text.Json.Serialization.JsonPropertyName("model_resources_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelResourcesId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -48,34 +48,34 @@ public sealed partial class RlStartTrainingSessionRequest /// /// Initializes a new instance of the class. /// - /// - /// Base model to use for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct + /// + /// Model resource to attach the session to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 /// /// /// Checkpoint ID to resume from
/// Example: 123e4567-e89b-12d3-a456-426614174000 /// - /// - /// Type of the training session. Defaults to TRAINER_AND_GENERATOR when unspecified. TRAINER_ONLY provisions only the trainer and rejects sample requests.
- /// Default Value: SESSION_TYPE_TRAINER_AND_GENERATOR + /// + /// HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id.
+ /// Example: your-org/llama-3-8b-finetuned /// /// - /// LoRA adapter configuration + /// LoRA adapter configuration for the session /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlStartTrainingSessionRequest( - string baseModel, + string modelResourcesId, string? resumeFromCheckpointId, - global::Together.RlSessionType? type, + string? resumeFromHfCheckpoint, global::Together.RlLoraConfig? loraConfig) { - this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); this.ResumeFromCheckpointId = resumeFromCheckpointId; - this.Type = type; + this.ResumeFromHfCheckpoint = resumeFromHfCheckpoint; this.LoraConfig = loraConfig; + this.ModelResourcesId = modelResourcesId ?? throw new global::System.ArgumentNullException(nameof(modelResourcesId)); } /// diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModel.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModel.Json.g.cs new file mode 100644 index 00000000..7e0c8140 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModel.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlSupportedModel + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlSupportedModel? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlSupportedModel), + jsonSerializerContext) as global::Together.RlSupportedModel; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSupportedModel? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlSupportedModel? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlSupportedModel), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSupportedModel; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs new file mode 100644 index 00000000..31c94808 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace Together +{ + /// + /// A base model supported by the RL service. Per-mode configs are present only when the model supports that mode. + /// + public sealed partial class RlSupportedModel + { + /// + /// Base model identifier to pass as base_model when creating a model resource
+ /// Example: Qwen/Qwen3-0.6B + ///
+ /// Qwen/Qwen3-0.6B + [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseModel { get; set; } + + /// + /// Training config. Set when the model supports at least one training mode. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("trainer_config")] + public global::Together.RlModelTrainerConfig? TrainerConfig { get; set; } + + /// + /// Inference config. Set when the model can be provisioned with generator replicas. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("generator_config")] + public global::Together.RlModelGeneratorConfig? GeneratorConfig { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Base model identifier to pass as base_model when creating a model resource
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Training config. Set when the model supports at least one training mode. + /// + /// + /// Inference config. Set when the model can be provisioned with generator replicas. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlSupportedModel( + string baseModel, + global::Together.RlModelTrainerConfig? trainerConfig, + global::Together.RlModelGeneratorConfig? generatorConfig) + { + this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); + this.TrainerConfig = trainerConfig; + this.GeneratorConfig = generatorConfig; + } + + /// + /// Initializes a new instance of the class. + /// + public RlSupportedModel() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.Json.g.cs new file mode 100644 index 00000000..59006e6e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlSupportedModelsListResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlSupportedModelsListResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlSupportedModelsListResponse), + jsonSerializerContext) as global::Together.RlSupportedModelsListResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlSupportedModelsListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlSupportedModelsListResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlSupportedModelsListResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlSupportedModelsListResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.g.cs new file mode 100644 index 00000000..0ddd0b0f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModelsListResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Together +{ + /// + /// List of base models supported by the RL service + /// + public sealed partial class RlSupportedModelsListResponse + { + /// + /// Supported base models for RL + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Supported base models for RL + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlSupportedModelsListResponse( + global::System.Collections.Generic.IList data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlSupportedModelsListResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.Json.g.cs new file mode 100644 index 00000000..a41ae73a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlTargetLogprobGradients + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlTargetLogprobGradients? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlTargetLogprobGradients), + jsonSerializerContext) as global::Together.RlTargetLogprobGradients; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTargetLogprobGradients? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlTargetLogprobGradients? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlTargetLogprobGradients), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTargetLogprobGradients; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.g.cs b/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.g.cs new file mode 100644 index 00000000..09462677 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTargetLogprobGradients.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Together +{ + /// + /// Per-token gradients of the loss with respect to target log-probabilities + /// + public sealed partial class RlTargetLogprobGradients + { + /// + /// Float array of per-token gradients (d loss / d log p)
+ /// Example: [-0.1, 0.05, -0.08, 0.12, -0.03] + ///
+ /// [-0.1, 0.05, -0.08, 0.12, -0.03] + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Data type of the float array
+ /// Default Value: D_TYPE_UNSPECIFIED + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("dtype")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlDTypeJsonConverter))] + public global::Together.RlDType? Dtype { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Float array of per-token gradients (d loss / d log p)
+ /// Example: [-0.1, 0.05, -0.08, 0.12, -0.03] + /// + /// + /// Data type of the float array
+ /// Default Value: D_TYPE_UNSPECIFIED + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlTargetLogprobGradients( + global::System.Collections.Generic.IList data, + global::Together.RlDType? dtype) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Dtype = dtype; + } + + /// + /// Initializes a new instance of the class. + /// + public RlTargetLogprobGradients() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.Json.g.cs new file mode 100644 index 00000000..a35c76e6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlTargetLogprobs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlTargetLogprobs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlTargetLogprobs), + jsonSerializerContext) as global::Together.RlTargetLogprobs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTargetLogprobs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlTargetLogprobs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlTargetLogprobs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTargetLogprobs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.g.cs b/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.g.cs new file mode 100644 index 00000000..9be877ed --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTargetLogprobs.g.cs @@ -0,0 +1,50 @@ + +#nullable enable + +namespace Together +{ + /// + /// Per-token log-probabilities from the target model + /// + public sealed partial class RlTargetLogprobs + { + /// + /// Float array of per-token log probabilities
+ /// Example: [-1.2, -0.8, -1.5, -0.9, -1.1] + ///
+ /// [-1.2, -0.8, -1.5, -0.9, -1.1] + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Float array of per-token log probabilities
+ /// Example: [-1.2, -0.8, -1.5, -0.9, -1.1] + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlTargetLogprobs( + global::System.Collections.Generic.IList data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public RlTargetLogprobs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpoint.Json.g.cs index 1c94e86d..7f281bcc 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpoint.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingCheckpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingCheckpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingCheckpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointOperation.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointOperation.Json.g.cs index ffd8472f..2fcbae51 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointOperation.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointOperation.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingCheckpointOperation; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingCheckpointOperation? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingCheckpointOperation; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointResult.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointResult.Json.g.cs index 4ffb8e52..7f586ac1 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointResult.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingCheckpointResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingCheckpointResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingCheckpointResult? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingCheckpointResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingOperationError.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingOperationError.Json.g.cs index ff19ef6c..a924bdf0 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingOperationError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingOperationError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingOperationError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingOperationError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingOperationError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSample.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSample.Json.g.cs index c8997cff..9985827d 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingSample.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSample.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingSample; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingSample? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingSample; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSample.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSample.g.cs index 0f812b9d..ecb3433b 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingSample.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSample.g.cs @@ -22,6 +22,12 @@ public sealed partial class RlTrainingSample [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.RlLossInputs LossInputs { get; set; } + /// + /// Policy versions that produced this sample's tokens. Echo back from `SampleResult.policy_segments`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("policy_segments")] + public global::System.Collections.Generic.IList? PolicySegments { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -37,15 +43,20 @@ public sealed partial class RlTrainingSample /// /// Loss function inputs /// + /// + /// Policy versions that produced this sample's tokens. Echo back from `SampleResult.policy_segments`. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RlTrainingSample( global::Together.RlModelInput modelInput, - global::Together.RlLossInputs lossInputs) + global::Together.RlLossInputs lossInputs, + global::System.Collections.Generic.IList? policySegments) { this.ModelInput = modelInput ?? throw new global::System.ArgumentNullException(nameof(modelInput)); this.LossInputs = lossInputs ?? throw new global::System.ArgumentNullException(nameof(lossInputs)); + this.PolicySegments = policySegments; } /// diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSession.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSession.Json.g.cs index d4823c6c..04bee325 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingSession.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingSession? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSession.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSession.g.cs index 4aa387c9..5ecf58a6 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSession.g.cs @@ -28,13 +28,10 @@ public sealed partial class RlTrainingSession public required global::Together.RlTrainingSessionStatus Status { get; set; } = global::Together.RlTrainingSessionStatus.TrainingSessionStatusUnspecified; /// - /// Base model used for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct + /// Structured detail for the training session's current error. Set when the session is in an error state. ///
- /// meta-llama/Meta-Llama-3-8B-Instruct - [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string BaseModel { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::Together.RlTrainingSessionError? Error { get; set; } /// /// List of saved inference checkpoints for this session @@ -89,21 +86,29 @@ public sealed partial class RlTrainingSession public required global::System.DateTime UpdatedAt { get; set; } /// - /// LoRA adapter configuration + /// LoRA adapter configuration for this session /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_config")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.RlLoraConfig LoraConfig { get; set; } /// - /// Type of the training session. TRAINER_AND_GENERATOR provisions both trainer and generator; TRAINER_ONLY provisions only the trainer and rejects generator-dependent operations such as sample.
- /// Default Value: SESSION_TYPE_UNSPECIFIED + /// Model resource this session is attached to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 ///
- /// global::Together.RlSessionType.SessionTypeUnspecified - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlSessionTypeJsonConverter))] + /// 123e4567-e89b-12d3-a456-426614174000 + [global::System.Text.Json.Serialization.JsonPropertyName("model_resources_id")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.RlSessionType Type { get; set; } = global::Together.RlSessionType.SessionTypeUnspecified; + public required string ModelResourcesId { get; set; } + + /// + /// ID of the user who created the training session
+ /// Example: user_123 + ///
+ /// user_123 + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedBy { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -122,10 +127,6 @@ public sealed partial class RlTrainingSession /// Status of the training session
/// Default Value: TRAINING_SESSION_STATUS_UNSPECIFIED /// - /// - /// Base model used for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct - /// /// /// List of saved inference checkpoints for this session /// @@ -146,11 +147,18 @@ public sealed partial class RlTrainingSession /// Example: 2026-01-02T00:00:05Z /// /// - /// LoRA adapter configuration + /// LoRA adapter configuration for this session + /// + /// + /// Model resource this session is attached to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 + /// + /// + /// ID of the user who created the training session
+ /// Example: user_123 /// - /// - /// Type of the training session. TRAINER_AND_GENERATOR provisions both trainer and generator; TRAINER_ONLY provisions only the trainer and rejects generator-dependent operations such as sample.
- /// Default Value: SESSION_TYPE_UNSPECIFIED + /// + /// Structured detail for the training session's current error. Set when the session is in an error state. /// /// /// Checkpoint ID this session was resumed from
@@ -162,19 +170,20 @@ public sealed partial class RlTrainingSession public RlTrainingSession( string id, global::Together.RlTrainingSessionStatus status, - string baseModel, global::System.Collections.Generic.IList inferenceCheckpoints, global::System.Collections.Generic.IList trainingCheckpoints, global::Together.OneOf step, global::System.DateTime createdAt, global::System.DateTime updatedAt, global::Together.RlLoraConfig loraConfig, - global::Together.RlSessionType type, + string modelResourcesId, + string createdBy, + global::Together.RlTrainingSessionError? error, string? resumeFromCheckpointId) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Status = status; - this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); + this.Error = error; this.InferenceCheckpoints = inferenceCheckpoints ?? throw new global::System.ArgumentNullException(nameof(inferenceCheckpoints)); this.TrainingCheckpoints = trainingCheckpoints ?? throw new global::System.ArgumentNullException(nameof(trainingCheckpoints)); this.ResumeFromCheckpointId = resumeFromCheckpointId; @@ -182,7 +191,8 @@ public RlTrainingSession( this.CreatedAt = createdAt; this.UpdatedAt = updatedAt; this.LoraConfig = loraConfig ?? throw new global::System.ArgumentNullException(nameof(loraConfig)); - this.Type = type; + this.ModelResourcesId = modelResourcesId ?? throw new global::System.ArgumentNullException(nameof(modelResourcesId)); + this.CreatedBy = createdBy ?? throw new global::System.ArgumentNullException(nameof(createdBy)); } /// diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.Json.g.cs new file mode 100644 index 00000000..ffec20ac --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RlTrainingSessionError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RlTrainingSessionError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RlTrainingSessionError), + jsonSerializerContext) as global::Together.RlTrainingSessionError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingSessionError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RlTrainingSessionError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RlTrainingSessionError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingSessionError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.g.cs new file mode 100644 index 00000000..463b8e26 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSessionError.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace Together +{ + /// + /// Structured detail for the training session's current error + /// + public sealed partial class RlTrainingSessionError + { + /// + /// Finite machine-readable reason code for UI branching + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlTrainingSessionErrorCode Code { get; set; } + + /// + /// User-safe human-readable detail for the current status
+ /// Example: The session could not start because the selected resource has no available capacity. + ///
+ /// The session could not start because the selected resource has no available capacity. + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Timestamp when this error was reported
+ /// Example: 2026-01-02T00:00:05Z + ///
+ /// 2026-01-02T00:00:05Z + [global::System.Text.Json.Serialization.JsonPropertyName("occurred_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime OccurredAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Finite machine-readable reason code for UI branching + /// + /// + /// User-safe human-readable detail for the current status
+ /// Example: The session could not start because the selected resource has no available capacity. + /// + /// + /// Timestamp when this error was reported
+ /// Example: 2026-01-02T00:00:05Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RlTrainingSessionError( + global::Together.RlTrainingSessionErrorCode code, + string message, + global::System.DateTime occurredAt) + { + this.Code = code; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.OccurredAt = occurredAt; + } + + /// + /// Initializes a new instance of the class. + /// + public RlTrainingSessionError() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSessionErrorCode.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSessionErrorCode.g.cs new file mode 100644 index 00000000..33e2f429 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSessionErrorCode.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Finite machine-readable training session lifecycle error code + /// + public enum RlTrainingSessionErrorCode + { + /// + /// + /// + TrainingSessionErrorCodeResourceAtCapacity, + /// + /// + /// + TrainingSessionErrorCodeResourceUnavailable, + /// + /// + /// + TrainingSessionErrorCodeSessionFailed, + /// + /// + /// + TrainingSessionErrorCodeTimedOut, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlTrainingSessionErrorCodeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlTrainingSessionErrorCode value) + { + return value switch + { + RlTrainingSessionErrorCode.TrainingSessionErrorCodeResourceAtCapacity => "TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY", + RlTrainingSessionErrorCode.TrainingSessionErrorCodeResourceUnavailable => "TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE", + RlTrainingSessionErrorCode.TrainingSessionErrorCodeSessionFailed => "TRAINING_SESSION_ERROR_CODE_SESSION_FAILED", + RlTrainingSessionErrorCode.TrainingSessionErrorCodeTimedOut => "TRAINING_SESSION_ERROR_CODE_TIMED_OUT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlTrainingSessionErrorCode? ToEnum(string value) + { + return value switch + { + "TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY" => RlTrainingSessionErrorCode.TrainingSessionErrorCodeResourceAtCapacity, + "TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE" => RlTrainingSessionErrorCode.TrainingSessionErrorCodeResourceUnavailable, + "TRAINING_SESSION_ERROR_CODE_SESSION_FAILED" => RlTrainingSessionErrorCode.TrainingSessionErrorCodeSessionFailed, + "TRAINING_SESSION_ERROR_CODE_TIMED_OUT" => RlTrainingSessionErrorCode.TrainingSessionErrorCodeTimedOut, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlTrainingSessionsListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RlTrainingSessionsListResponse.Json.g.cs index d827dbee..cd60f1c1 100644 --- a/src/libs/Together/Generated/Together.Models.RlTrainingSessionsListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlTrainingSessionsListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.RlTrainingSessionsListResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RlTrainingSessionsListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlTrainingSessionsListResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.RlWeightSyncType.g.cs b/src/libs/Together/Generated/Together.Models.RlWeightSyncType.g.cs new file mode 100644 index 00000000..c09de59f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RlWeightSyncType.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Together +{ + /// + /// How the trainer's updated weights are propagated to the generator after an optimizer step. SYNCHRONOUS publishes inline before the step returns; BACKGROUND_PUBLISH returns immediately and publishes once in-flight rollouts drain; PIPELINE overlaps the publish with in-flight rollouts so they continue decoding under the new weights.
+ /// Default Value: WEIGHT_SYNC_TYPE_UNSPECIFIED + ///
+ public enum RlWeightSyncType + { + /// + /// + /// + WeightSyncTypeBackgroundPublish, + /// + /// + /// + WeightSyncTypePipeline, + /// + /// + /// + WeightSyncTypeSynchronous, + /// + /// + /// + WeightSyncTypeUnspecified, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RlWeightSyncTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RlWeightSyncType value) + { + return value switch + { + RlWeightSyncType.WeightSyncTypeBackgroundPublish => "WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH", + RlWeightSyncType.WeightSyncTypePipeline => "WEIGHT_SYNC_TYPE_PIPELINE", + RlWeightSyncType.WeightSyncTypeSynchronous => "WEIGHT_SYNC_TYPE_SYNCHRONOUS", + RlWeightSyncType.WeightSyncTypeUnspecified => "WEIGHT_SYNC_TYPE_UNSPECIFIED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RlWeightSyncType? ToEnum(string value) + { + return value switch + { + "WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH" => RlWeightSyncType.WeightSyncTypeBackgroundPublish, + "WEIGHT_SYNC_TYPE_PIPELINE" => RlWeightSyncType.WeightSyncTypePipeline, + "WEIGHT_SYNC_TYPE_SYNCHRONOUS" => RlWeightSyncType.WeightSyncTypeSynchronous, + "WEIGHT_SYNC_TYPE_UNSPECIFIED" => RlWeightSyncType.WeightSyncTypeUnspecified, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RolloutServiceListRolloutsFilter.g.cs b/src/libs/Together/Generated/Together.Models.RolloutServiceListRolloutsFilter.g.cs new file mode 100644 index 00000000..27ee59af --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RolloutServiceListRolloutsFilter.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Narrow results to active or terminal rollouts. Omit to list all rollouts. + /// + public enum RolloutServiceListRolloutsFilter + { + /// + /// + /// + RolloutFilterActive, + /// + /// + /// + RolloutFilterTerminal, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RolloutServiceListRolloutsFilterExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RolloutServiceListRolloutsFilter value) + { + return value switch + { + RolloutServiceListRolloutsFilter.RolloutFilterActive => "ROLLOUT_FILTER_ACTIVE", + RolloutServiceListRolloutsFilter.RolloutFilterTerminal => "ROLLOUT_FILTER_TERMINAL", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RolloutServiceListRolloutsFilter? ToEnum(string value) + { + return value switch + { + "ROLLOUT_FILTER_ACTIVE" => RolloutServiceListRolloutsFilter.RolloutFilterActive, + "ROLLOUT_FILTER_TERMINAL" => RolloutServiceListRolloutsFilter.RolloutFilterTerminal, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SecretResponseItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.SecretResponseItem.Json.g.cs index a0436c9c..9c82cb39 100644 --- a/src/libs/Together/Generated/Together.Models.SecretResponseItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SecretResponseItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SecretResponseItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SecretResponseItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SecretResponseItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SecretResponseItemObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.SecretResponseItemObject.Json.g.cs index 5c886298..9d64aef1 100644 --- a/src/libs/Together/Generated/Together.Models.SecretResponseItemObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SecretResponseItemObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SecretResponseItemObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SecretResponseItemObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SecretResponseItemObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs index f449ce49..347dbd55 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponse?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponse?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs index a7117059..f2ad73b0 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponseResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs index 024daf81..abc8d918 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponseResponseError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponseError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseResponseError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs index 6183468d..047b5541 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponseVariant2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs index 6d34d132..7f3fdd7b 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponseVariant2Data; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2Data? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2Data; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs index 963def23..1c50c491 100644 --- a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SessionListResponseVariant2DataSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2DataSession? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2DataSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SignedURLResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.SignedURLResponse.Json.g.cs index 5162d7e1..f808c724 100644 --- a/src/libs/Together/Generated/Together.Models.SignedURLResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SignedURLResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SignedURLResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SignedURLResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SignedURLResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SlurmStartupScripts.Json.g.cs b/src/libs/Together/Generated/Together.Models.SlurmStartupScripts.Json.g.cs index ff698977..1a42a45a 100644 --- a/src/libs/Together/Generated/Together.Models.SlurmStartupScripts.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SlurmStartupScripts.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.SlurmStartupScripts; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SlurmStartupScripts? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.SlurmStartupScripts; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SlurmWebConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.SlurmWebConfig.Json.g.cs new file mode 100644 index 00000000..b9484ec6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SlurmWebConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SlurmWebConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SlurmWebConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SlurmWebConfig), + jsonSerializerContext) as global::Together.SlurmWebConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SlurmWebConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SlurmWebConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SlurmWebConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SlurmWebConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.SlurmWebConfig.g.cs b/src/libs/Together/Generated/Together.Models.SlurmWebConfig.g.cs new file mode 100644 index 00000000..30064715 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SlurmWebConfig.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for the Slurm Web cluster add-on. + /// + public sealed partial class SlurmWebConfig + { + /// + /// Whether to enable the Slurm Web add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether to enable the Slurm Web add-on. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SlurmWebConfig( + bool? enabled) + { + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public SlurmWebConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SlurmWebState.Json.g.cs b/src/libs/Together/Generated/Together.Models.SlurmWebState.Json.g.cs new file mode 100644 index 00000000..63df020f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SlurmWebState.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SlurmWebState + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SlurmWebState? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SlurmWebState), + jsonSerializerContext) as global::Together.SlurmWebState; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SlurmWebState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SlurmWebState? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SlurmWebState), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SlurmWebState; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.SlurmWebState.g.cs b/src/libs/Together/Generated/Together.Models.SlurmWebState.g.cs new file mode 100644 index 00000000..4ebdc90f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SlurmWebState.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Runtime state for the Slurm Web cluster add-on. + /// + public sealed partial class SlurmWebState + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs index 7b708963..9f774943 100644 --- a/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.StreamOutput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.StreamOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.StreamOutput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.StreamSentinel.Json.g.cs b/src/libs/Together/Generated/Together.Models.StreamSentinel.Json.g.cs index 5b16a830..9e53fb90 100644 --- a/src/libs/Together/Generated/Together.Models.StreamSentinel.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.StreamSentinel.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.StreamSentinel; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.StreamSentinel? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.StreamSentinel; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsModality.g.cs b/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsModality.g.cs new file mode 100644 index 00000000..bc50ba50 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsModality.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Filter models by input modality. + /// + public enum SupportedModelsServiceListSupportedModelsModality + { + /// + /// + /// + ModalityAudio, + /// + /// + /// + ModalityImage, + /// + /// + /// + ModalityText, + /// + /// + /// + ModalityVideo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SupportedModelsServiceListSupportedModelsModalityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SupportedModelsServiceListSupportedModelsModality value) + { + return value switch + { + SupportedModelsServiceListSupportedModelsModality.ModalityAudio => "MODALITY_AUDIO", + SupportedModelsServiceListSupportedModelsModality.ModalityImage => "MODALITY_IMAGE", + SupportedModelsServiceListSupportedModelsModality.ModalityText => "MODALITY_TEXT", + SupportedModelsServiceListSupportedModelsModality.ModalityVideo => "MODALITY_VIDEO", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SupportedModelsServiceListSupportedModelsModality? ToEnum(string value) + { + return value switch + { + "MODALITY_AUDIO" => SupportedModelsServiceListSupportedModelsModality.ModalityAudio, + "MODALITY_IMAGE" => SupportedModelsServiceListSupportedModelsModality.ModalityImage, + "MODALITY_TEXT" => SupportedModelsServiceListSupportedModelsModality.ModalityText, + "MODALITY_VIDEO" => SupportedModelsServiceListSupportedModelsModality.ModalityVideo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsProduct.g.cs b/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsProduct.g.cs new file mode 100644 index 00000000..5979de88 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SupportedModelsServiceListSupportedModelsProduct.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Filter models by product surface. + /// + public enum SupportedModelsServiceListSupportedModelsProduct + { + /// + /// + /// + ProductDedicated, + /// + /// + /// + ProductFineTuning, + /// + /// + /// + ProductServerless, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SupportedModelsServiceListSupportedModelsProductExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SupportedModelsServiceListSupportedModelsProduct value) + { + return value switch + { + SupportedModelsServiceListSupportedModelsProduct.ProductDedicated => "PRODUCT_DEDICATED", + SupportedModelsServiceListSupportedModelsProduct.ProductFineTuning => "PRODUCT_FINE_TUNING", + SupportedModelsServiceListSupportedModelsProduct.ProductServerless => "PRODUCT_SERVERLESS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SupportedModelsServiceListSupportedModelsProduct? ToEnum(string value) + { + return value switch + { + "PRODUCT_DEDICATED" => SupportedModelsServiceListSupportedModelsProduct.ProductDedicated, + "PRODUCT_FINE_TUNING" => SupportedModelsServiceListSupportedModelsProduct.ProductFineTuning, + "PRODUCT_SERVERLESS" => SupportedModelsServiceListSupportedModelsProduct.ProductServerless, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ToolChoice2.Json.g.cs b/src/libs/Together/Generated/Together.Models.ToolChoice2.Json.g.cs index e137f4e9..2de5bafc 100644 --- a/src/libs/Together/Generated/Together.Models.ToolChoice2.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ToolChoice2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ToolChoice2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ToolChoice2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ToolChoice2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ToolChoiceFunction.Json.g.cs b/src/libs/Together/Generated/Together.Models.ToolChoiceFunction.Json.g.cs index bfe034e4..46403b45 100644 --- a/src/libs/Together/Generated/Together.Models.ToolChoiceFunction.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ToolChoiceFunction.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ToolChoiceFunction; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ToolChoiceFunction? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ToolChoiceFunction; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ToolsPart.Json.g.cs b/src/libs/Together/Generated/Together.Models.ToolsPart.Json.g.cs index f845bf8c..16371523 100644 --- a/src/libs/Together/Generated/Together.Models.ToolsPart.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ToolsPart.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ToolsPart; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ToolsPart? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ToolsPart; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ToolsPartFunction.Json.g.cs b/src/libs/Together/Generated/Together.Models.ToolsPartFunction.Json.g.cs index f8ebf404..9913b869 100644 --- a/src/libs/Together/Generated/Together.Models.ToolsPartFunction.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ToolsPartFunction.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ToolsPartFunction; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ToolsPartFunction? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ToolsPartFunction; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.ToolsPartFunctionParameters.Json.g.cs b/src/libs/Together/Generated/Together.Models.ToolsPartFunctionParameters.Json.g.cs index 986239f5..f5bc6615 100644 --- a/src/libs/Together/Generated/Together.Models.ToolsPartFunctionParameters.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ToolsPartFunctionParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.ToolsPartFunctionParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ToolsPartFunctionParameters? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.ToolsPartFunctionParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.TopLogprobs.Json.g.cs b/src/libs/Together/Generated/Together.Models.TopLogprobs.Json.g.cs index 2e884362..3844e70e 100644 --- a/src/libs/Together/Generated/Together.Models.TopLogprobs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.TopLogprobs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.TopLogprobs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.TopLogprobs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.TopLogprobs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.TorchpassConfig.Json.g.cs b/src/libs/Together/Generated/Together.Models.TorchpassConfig.Json.g.cs new file mode 100644 index 00000000..6685728b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.TorchpassConfig.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class TorchpassConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.TorchpassConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.TorchpassConfig), + jsonSerializerContext) as global::Together.TorchpassConfig; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.TorchpassConfig? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.TorchpassConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.TorchpassConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.TorchpassConfig; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.TorchpassConfig.g.cs b/src/libs/Together/Generated/Together.Models.TorchpassConfig.g.cs new file mode 100644 index 00000000..01fbbe11 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.TorchpassConfig.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for the Model Aware TorchPass cluster add-on. + /// + public sealed partial class TorchpassConfig + { + /// + /// Whether to enable the Model Aware TorchPass add-on. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether to enable the Model Aware TorchPass add-on. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public TorchpassConfig( + bool? enabled) + { + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public TorchpassConfig() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.TorchpassState.Json.g.cs b/src/libs/Together/Generated/Together.Models.TorchpassState.Json.g.cs new file mode 100644 index 00000000..e66e18f4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.TorchpassState.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class TorchpassState + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.TorchpassState? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.TorchpassState), + jsonSerializerContext) as global::Together.TorchpassState; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.TorchpassState? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.TorchpassState? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.TorchpassState), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.TorchpassState; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.TorchpassState.g.cs b/src/libs/Together/Generated/Together.Models.TorchpassState.g.cs new file mode 100644 index 00000000..8aac6b61 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.TorchpassState.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// Runtime state for the Model Aware TorchPass cluster add-on. + /// + public sealed partial class TorchpassState + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.Json.g.cs b/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.Json.g.cs index ed0fe7c0..813796a0 100644 --- a/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.TrainingMethodDPO; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.TrainingMethodDPO? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.TrainingMethodDPO; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.g.cs b/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.g.cs index 3b22889a..7b74a7d2 100644 --- a/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.g.cs +++ b/src/libs/Together/Generated/Together.Models.TrainingMethodDPO.g.cs @@ -19,13 +19,13 @@ public sealed partial class TrainingMethodDPO /// Default Value: 0.1 ///
[global::System.Text.Json.Serialization.JsonPropertyName("dpo_beta")] - public float? DpoBeta { get; set; } + public double? DpoBeta { get; set; } /// - /// Default Value: 0 + /// Default Value: 0.0 /// [global::System.Text.Json.Serialization.JsonPropertyName("rpo_alpha")] - public float? RpoAlpha { get; set; } + public double? RpoAlpha { get; set; } /// /// Default Value: false @@ -40,10 +40,10 @@ public sealed partial class TrainingMethodDPO public bool? DpoReferenceFree { get; set; } /// - /// Default Value: 0 + /// Default Value: 0.0 /// [global::System.Text.Json.Serialization.JsonPropertyName("simpo_gamma")] - public float? SimpoGamma { get; set; } + public double? SimpoGamma { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -59,7 +59,7 @@ public sealed partial class TrainingMethodDPO /// Default Value: 0.1 /// /// - /// Default Value: 0 + /// Default Value: 0.0 /// /// /// Default Value: false @@ -68,18 +68,18 @@ public sealed partial class TrainingMethodDPO /// Default Value: false /// /// - /// Default Value: 0 + /// Default Value: 0.0 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public TrainingMethodDPO( global::Together.TrainingMethodDPOMethod method, - float? dpoBeta, - float? rpoAlpha, + double? dpoBeta, + double? rpoAlpha, bool? dpoNormalizeLogratiosByLength, bool? dpoReferenceFree, - float? simpoGamma) + double? simpoGamma) { this.Method = method; this.DpoBeta = dpoBeta; diff --git a/src/libs/Together/Generated/Together.Models.TrainingMethodSFT.Json.g.cs b/src/libs/Together/Generated/Together.Models.TrainingMethodSFT.Json.g.cs index a6c1ccbe..d9e29d95 100644 --- a/src/libs/Together/Generated/Together.Models.TrainingMethodSFT.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.TrainingMethodSFT.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.TrainingMethodSFT; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.TrainingMethodSFT? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.TrainingMethodSFT; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.UpdateDeploymentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.UpdateDeploymentRequest.Json.g.cs index f2bdd480..d13b36d6 100644 --- a/src/libs/Together/Generated/Together.Models.UpdateDeploymentRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.UpdateDeploymentRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.UpdateDeploymentRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UpdateDeploymentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.UpdateDeploymentRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs index 864c1da8..73c936f4 100644 --- a/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.UpdateEndpointRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UpdateEndpointRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.UpdateEndpointRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.UpdateSecretRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.UpdateSecretRequest.Json.g.cs index b44adb51..2a99b9ce 100644 --- a/src/libs/Together/Generated/Together.Models.UpdateSecretRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.UpdateSecretRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.UpdateSecretRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UpdateSecretRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.UpdateSecretRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.UpdateVolumeRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.UpdateVolumeRequest.Json.g.cs index 74d6a005..49fab499 100644 --- a/src/libs/Together/Generated/Together.Models.UpdateVolumeRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.UpdateVolumeRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.UpdateVolumeRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UpdateVolumeRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.UpdateVolumeRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.UsageData.Json.g.cs b/src/libs/Together/Generated/Together.Models.UsageData.Json.g.cs index 1ff2405b..d298b403 100644 --- a/src/libs/Together/Generated/Together.Models.UsageData.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.UsageData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.UsageData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UsageData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.UsageData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VersionHistoryItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.VersionHistoryItem.Json.g.cs index 2c29a6df..2f335254 100644 --- a/src/libs/Together/Generated/Together.Models.VersionHistoryItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VersionHistoryItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VersionHistoryItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VersionHistoryItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VersionHistoryItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoFrameImageInput.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoFrameImageInput.Json.g.cs index 5b812481..04fa5ef9 100644 --- a/src/libs/Together/Generated/Together.Models.VideoFrameImageInput.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoFrameImageInput.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoFrameImageInput; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoFrameImageInput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoFrameImageInput; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoJob.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoJob.Json.g.cs index 4208f597..7d1daab9 100644 --- a/src/libs/Together/Generated/Together.Models.VideoJob.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoJob.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoJob; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoJob? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoJob; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoJobError.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoJobError.Json.g.cs index 3e264491..93cf7ad0 100644 --- a/src/libs/Together/Generated/Together.Models.VideoJobError.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoJobError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoJobError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoJobError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoJobError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoJobObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoJobObject.Json.g.cs index 4fc7efd1..a67f8b43 100644 --- a/src/libs/Together/Generated/Together.Models.VideoJobObject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoJobObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoJobObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoJobObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoJobObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoJobOutputs.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoJobOutputs.Json.g.cs index 36f4b657..2b3487d0 100644 --- a/src/libs/Together/Generated/Together.Models.VideoJobOutputs.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoJobOutputs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoJobOutputs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoJobOutputs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoJobOutputs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoMedia.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoMedia.Json.g.cs index b35bbb6f..d42a7b1b 100644 --- a/src/libs/Together/Generated/Together.Models.VideoMedia.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoMedia.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoMedia; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoMedia? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoMedia; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VideoRef.Json.g.cs b/src/libs/Together/Generated/Together.Models.VideoRef.Json.g.cs index d3092478..8369265c 100644 --- a/src/libs/Together/Generated/Together.Models.VideoRef.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VideoRef.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VideoRef; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VideoRef? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VideoRef; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeContent.Json.g.cs b/src/libs/Together/Generated/Together.Models.VolumeContent.Json.g.cs index 2e3381f1..2f2d212b 100644 --- a/src/libs/Together/Generated/Together.Models.VolumeContent.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VolumeContent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VolumeContent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VolumeContent? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VolumeContent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeContentRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.VolumeContentRequest.Json.g.cs index b769fa22..f7e00532 100644 --- a/src/libs/Together/Generated/Together.Models.VolumeContentRequest.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VolumeContentRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VolumeContentRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VolumeContentRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VolumeContentRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeMount.Json.g.cs b/src/libs/Together/Generated/Together.Models.VolumeMount.Json.g.cs index 6cfb98b1..ef8ad3ce 100644 --- a/src/libs/Together/Generated/Together.Models.VolumeMount.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VolumeMount.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VolumeMount; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VolumeMount? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VolumeMount; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeResponseItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.VolumeResponseItem.Json.g.cs index 513a8fd9..36996d82 100644 --- a/src/libs/Together/Generated/Together.Models.VolumeResponseItem.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VolumeResponseItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VolumeResponseItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VolumeResponseItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VolumeResponseItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeResponseItemVersionHistory.Json.g.cs b/src/libs/Together/Generated/Together.Models.VolumeResponseItemVersionHistory.Json.g.cs index b64c1515..83946e1f 100644 --- a/src/libs/Together/Generated/Together.Models.VolumeResponseItemVersionHistory.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.VolumeResponseItemVersionHistory.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.VolumeResponseItemVersionHistory; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.VolumeResponseItemVersionHistory? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.VolumeResponseItemVersionHistory; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.Models.VolumeServiceListModelsVisibility.g.cs b/src/libs/Together/Generated/Together.Models.VolumeServiceListModelsVisibility.g.cs new file mode 100644 index 00000000..0d118d1e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.VolumeServiceListModelsVisibility.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + /// + public enum VolumeServiceListModelsVisibility + { + /// + /// + /// + VisibilityInternal, + /// + /// + /// + VisibilityPrivate, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class VolumeServiceListModelsVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this VolumeServiceListModelsVisibility value) + { + return value switch + { + VolumeServiceListModelsVisibility.VisibilityInternal => "VISIBILITY_INTERNAL", + VolumeServiceListModelsVisibility.VisibilityPrivate => "VISIBILITY_PRIVATE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static VolumeServiceListModelsVisibility? ToEnum(string value) + { + return value switch + { + "VISIBILITY_INTERNAL" => VolumeServiceListModelsVisibility.VisibilityInternal, + "VISIBILITY_PRIVATE" => VolumeServiceListModelsVisibility.VisibilityPrivate, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs new file mode 100644 index 00000000..d2ff9e54 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class WhoamiResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.WhoamiResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.WhoamiResponse), + jsonSerializerContext) as global::Together.WhoamiResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.WhoamiResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.WhoamiResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.WhoamiResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs new file mode 100644 index 00000000..31474c39 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class WhoamiResponse + { + /// + /// The ID of the API key that authenticated the request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ApiKeyId { get; set; } + + /// + /// The ID of the project the API key is scoped to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// Human-readable name of the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("project_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectName { get; set; } + + /// + /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("project_slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectSlug { get; set; } + + /// + /// The ID of the organization that owns the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("organization_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationId { get; set; } + + /// + /// Human-readable name of the organization. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("organization_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationName { get; set; } + + /// + /// The ID of the authenticated user, if available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] + public string? UserId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the API key that authenticated the request. + /// + /// + /// The ID of the project the API key is scoped to. + /// + /// + /// Human-readable name of the project. + /// + /// + /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// + /// + /// The ID of the organization that owns the project. + /// + /// + /// Human-readable name of the organization. + /// + /// + /// The ID of the authenticated user, if available. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WhoamiResponse( + string apiKeyId, + string projectId, + string projectName, + string projectSlug, + string organizationId, + string organizationName, + string? userId) + { + this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.ProjectName = projectName ?? throw new global::System.ArgumentNullException(nameof(projectName)); + this.ProjectSlug = projectSlug ?? throw new global::System.ArgumentNullException(nameof(projectSlug)); + this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); + this.OrganizationName = organizationName ?? throw new global::System.ArgumentNullException(nameof(organizationName)); + this.UserId = userId; + } + + /// + /// Initializes a new instance of the class. + /// + public WhoamiResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs b/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs index 36ef5f77..7aa9b124 100644 --- a/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs +++ b/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ModelsClient { + private static readonly global::Together.AutoSDKServer[] s_ModelsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ModelsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,7 +145,9 @@ partial void ProcessModelsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/models", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ModelsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("dedicated", dedicated?.ToString().ToLowerInvariant()) ; @@ -380,18 +395,17 @@ partial void ProcessModelsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -418,18 +432,17 @@ partial void ProcessModelsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // NotFound if ((int)__response.StatusCode == 404) @@ -456,18 +469,17 @@ partial void ProcessModelsResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -494,18 +506,17 @@ partial void ProcessModelsResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Timeout if ((int)__response.StatusCode == 504) @@ -532,18 +543,17 @@ partial void ProcessModelsResponseContent( __exception_504 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, - statusCode: __response.StatusCode) - { - ResponseBody = __content_504, - ResponseObject = __value_504, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_504, + responseObject: __value_504, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -577,17 +587,15 @@ partial void ProcessModelsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -624,17 +632,15 @@ partial void ProcessModelsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs b/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs index a77cafb7..21403f42 100644 --- a/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs +++ b/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ModelsClient { + private static readonly global::Together.AutoSDKServer[] s_UploadModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_UploadModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -137,7 +150,9 @@ partial void ProcessUploadModelResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/models", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_UploadModelServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -395,17 +410,15 @@ partial void ProcessUploadModelResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -442,17 +455,15 @@ partial void ProcessUploadModelResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.ModelsClient.g.cs b/src/libs/Together/Generated/Together.ModelsClient.g.cs index 860f0349..c493db61 100644 --- a/src/libs/Together/Generated/Together.ModelsClient.g.cs +++ b/src/libs/Together/Generated/Together.ModelsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class ModelsClient : global::Together.IModelsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class ModelsClient : global::Together.IModelsClient, globa public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class ModelsClient : global::Together.IModelsClient, globa public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the ModelsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.OneOf.2.Json.g.cs b/src/libs/Together/Generated/Together.OneOf.2.Json.g.cs index ae9d4559..9b8a01da 100644 --- a/src/libs/Together/Generated/Together.OneOf.2.Json.g.cs +++ b/src/libs/Together/Generated/Together.OneOf.2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OneOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OneOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.OneOf.3.Json.g.cs b/src/libs/Together/Generated/Together.OneOf.3.Json.g.cs index 165439c9..2693893d 100644 --- a/src/libs/Together/Generated/Together.OneOf.3.Json.g.cs +++ b/src/libs/Together/Generated/Together.OneOf.3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OneOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OneOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.OneOf.4.Json.g.cs b/src/libs/Together/Generated/Together.OneOf.4.Json.g.cs index 3cac0c1b..6d5bed59 100644 --- a/src/libs/Together/Generated/Together.OneOf.4.Json.g.cs +++ b/src/libs/Together/Generated/Together.OneOf.4.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OneOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OneOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.OneOf.5.Json.g.cs b/src/libs/Together/Generated/Together.OneOf.5.Json.g.cs index 3b8b57a5..017ed6b7 100644 --- a/src/libs/Together/Generated/Together.OneOf.5.Json.g.cs +++ b/src/libs/Together/Generated/Together.OneOf.5.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::Together.OneOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::Together.OneOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Together.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs new file mode 100644 index 00000000..9383f2f0 --- /dev/null +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class PlacementProfileServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_PlacementProfileServiceGetPlacementProfileServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_PlacementProfileServiceGetPlacementProfileSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_PlacementProfileServiceGetPlacementProfileSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_PlacementProfileServiceGetPlacementProfileSecurityRequirement0, + }; + partial void PreparePlacementProfileServiceGetPlacementProfileArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PreparePlacementProfileServiceGetPlacementProfileRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessPlacementProfileServiceGetPlacementProfileResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a placement profile
+ /// Retrieves a reusable placement profile and its ordered region preferences. + ///
+ /// + /// Project identifier. + /// + /// + /// Placement profile identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PlacementProfileServiceGetPlacementProfileAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PlacementProfileServiceGetPlacementProfileAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a placement profile
+ /// Retrieves a reusable placement profile and its ordered region preferences. + ///
+ /// + /// Project identifier. + /// + /// + /// Placement profile identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PlacementProfileServiceGetPlacementProfileAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PreparePlacementProfileServiceGetPlacementProfileArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_PlacementProfileServiceGetPlacementProfileSecurityRequirements, + operationName: "PlacementProfileServiceGetPlacementProfileAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/placement-profiles/{id}", + baseUri: ResolveBaseUri( + servers: s_PlacementProfileServiceGetPlacementProfileServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePlacementProfileServiceGetPlacementProfileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceGetPlacementProfile", + methodName: "PlacementProfileServiceGetPlacementProfileAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceGetPlacementProfile", + methodName: "PlacementProfileServiceGetPlacementProfileAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceGetPlacementProfile", + methodName: "PlacementProfileServiceGetPlacementProfileAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessPlacementProfileServiceGetPlacementProfileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceGetPlacementProfile", + methodName: "PlacementProfileServiceGetPlacementProfileAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceGetPlacementProfile", + methodName: "PlacementProfileServiceGetPlacementProfileAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessPlacementProfileServiceGetPlacementProfileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DePlacementProfile.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DePlacementProfile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs new file mode 100644 index 00000000..d8356b72 --- /dev/null +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs @@ -0,0 +1,507 @@ + +#nullable enable + +namespace Together +{ + public partial class PlacementProfileServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_PlacementProfileServiceListPlacementProfilesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_PlacementProfileServiceListPlacementProfilesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_PlacementProfileServiceListPlacementProfilesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_PlacementProfileServiceListPlacementProfilesSecurityRequirement0, + }; + partial void PreparePlacementProfileServiceListPlacementProfilesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref int? limit, + ref string? after); + partial void PreparePlacementProfileServiceListPlacementProfilesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + int? limit, + string? after); + partial void ProcessPlacementProfileServiceListPlacementProfilesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List placement profiles
+ /// Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of profiles to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous placement profile list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PlacementProfileServiceListPlacementProfilesAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PlacementProfileServiceListPlacementProfilesAsResponseAsync( + projectId: projectId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List placement profiles
+ /// Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of profiles to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous placement profile list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PlacementProfileServiceListPlacementProfilesAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PreparePlacementProfileServiceListPlacementProfilesArguments( + httpClient: HttpClient, + projectId: ref projectId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_PlacementProfileServiceListPlacementProfilesSecurityRequirements, + operationName: "PlacementProfileServiceListPlacementProfilesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/placement-profiles", + baseUri: ResolveBaseUri( + servers: s_PlacementProfileServiceListPlacementProfilesServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePlacementProfileServiceListPlacementProfilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceListPlacementProfiles", + methodName: "PlacementProfileServiceListPlacementProfilesAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceListPlacementProfiles", + methodName: "PlacementProfileServiceListPlacementProfilesAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceListPlacementProfiles", + methodName: "PlacementProfileServiceListPlacementProfilesAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", + httpMethod: "GET", + 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::Together.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); + ProcessPlacementProfileServiceListPlacementProfilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceListPlacementProfiles", + methodName: "PlacementProfileServiceListPlacementProfilesAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PlacementProfileServiceListPlacementProfiles", + methodName: "PlacementProfileServiceListPlacementProfilesAsync", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessPlacementProfileServiceListPlacementProfilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListPlacementProfilesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListPlacementProfilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.PlacementProfileServiceClient.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs new file mode 100644 index 00000000..a516e23b --- /dev/null +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class PlacementProfileServiceClient : global::Together.IPlacementProfileServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the PlacementProfileServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public PlacementProfileServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the PlacementProfileServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public PlacementProfileServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the PlacementProfileServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public PlacementProfileServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs b/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs index 6f8fef52..9ff8e59b 100644 --- a/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_CancelQueueJobServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CancelQueueJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -117,7 +130,9 @@ partial void ProcessCancelQueueJobResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/queue/cancel", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CancelQueueJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessCancelQueueJobResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request not found if ((int)__response.StatusCode == 404) @@ -406,18 +420,17 @@ partial void ProcessCancelQueueJobResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Job could not be canceled (already completed/failed) if ((int)__response.StatusCode == 409) @@ -444,18 +457,17 @@ partial void ProcessCancelQueueJobResponseContent( __exception_409 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -482,18 +494,17 @@ partial void ProcessCancelQueueJobResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -527,17 +538,15 @@ partial void ProcessCancelQueueJobResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -574,17 +583,15 @@ partial void ProcessCancelQueueJobResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs b/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs new file mode 100644 index 00000000..43bb5375 --- /dev/null +++ b/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs @@ -0,0 +1,588 @@ + +#nullable enable + +namespace Together +{ + public partial class QueueClient + { + + private static readonly global::Together.AutoSDKServer[] s_ClearQueueServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ClearQueueSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ClearQueueSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ClearQueueSecurityRequirement0, + }; + partial void PrepareClearQueueArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.QueueClearRequest request); + partial void PrepareClearQueueRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.QueueClearRequest request); + partial void ProcessClearQueueResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessClearQueueResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ClearQueueAsync( + + global::Together.QueueClearRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ClearQueueAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ClearQueueAsResponseAsync( + + global::Together.QueueClearRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareClearQueueArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ClearQueueSecurityRequirements, + operationName: "ClearQueueAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/queue/clear", + baseUri: ResolveBaseUri( + servers: s_ClearQueueServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareClearQueueRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ClearQueue", + methodName: "ClearQueueAsync", + pathTemplate: "\"/queue/clear\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ClearQueue", + methodName: "ClearQueueAsync", + pathTemplate: "\"/queue/clear\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ClearQueue", + methodName: "ClearQueueAsync", + pathTemplate: "\"/queue/clear\"", + 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::Together.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); + ProcessClearQueueResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ClearQueue", + methodName: "ClearQueueAsync", + pathTemplate: "\"/queue/clear\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ClearQueue", + methodName: "ClearQueueAsync", + pathTemplate: "\"/queue/clear\"", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.QueueError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.QueueError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.QueueError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Together.QueueError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Together.QueueError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Together.QueueError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::Together.QueueError? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::Together.QueueError.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::Together.QueueError.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + 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); + ProcessClearQueueResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.QueueClearResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.QueueClearResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Clear a model's pending jobs
+ /// Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + ///
+ /// + /// Model identifier whose pending jobs should be canceled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ClearQueueAsync( + string model, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.QueueClearRequest + { + Model = model, + }; + + return await ClearQueueAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs b/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs index 5fd9673f..a455493d 100644 --- a/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_GetQueueJobStatusServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetQueueJobStatusSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetQueueJobStatusResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/queue/status", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetQueueJobStatusServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("request_id", requestId) .AddRequiredParameter("model", model) @@ -372,18 +387,17 @@ partial void ProcessGetQueueJobStatusResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -410,18 +424,17 @@ partial void ProcessGetQueueJobStatusResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request not found if ((int)__response.StatusCode == 404) @@ -448,18 +461,17 @@ partial void ProcessGetQueueJobStatusResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -486,18 +498,17 @@ partial void ProcessGetQueueJobStatusResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -531,17 +542,15 @@ partial void ProcessGetQueueJobStatusResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -578,17 +587,15 @@ partial void ProcessGetQueueJobStatusResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs b/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs index ab52a0f7..8f69b4c2 100644 --- a/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_GetQueueMetricsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetQueueMetricsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetQueueMetricsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/queue/metrics", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetQueueMetricsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model", model) ; @@ -358,18 +373,17 @@ partial void ProcessGetQueueMetricsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -396,18 +410,17 @@ partial void ProcessGetQueueMetricsResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -434,18 +447,17 @@ partial void ProcessGetQueueMetricsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -479,17 +491,15 @@ partial void ProcessGetQueueMetricsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -526,17 +536,15 @@ partial void ProcessGetQueueMetricsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs b/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs index c317e682..cb79b068 100644 --- a/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_SubmitQueueJobServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SubmitQueueJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -117,7 +130,9 @@ partial void ProcessSubmitQueueJobResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/queue/submit", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SubmitQueueJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessSubmitQueueJobResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -406,18 +420,17 @@ partial void ProcessSubmitQueueJobResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -444,18 +457,17 @@ partial void ProcessSubmitQueueJobResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -489,17 +501,15 @@ partial void ProcessSubmitQueueJobResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -536,17 +546,15 @@ partial void ProcessSubmitQueueJobResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -565,12 +573,13 @@ partial void ProcessSubmitQueueJobResponseContent( /// or cancel the job. ///
/// - /// Arbitrary JSON metadata stored with the job and returned in status
- /// responses. The model and system may add or update keys during
- /// processing. + /// Arbitrary JSON metadata stored with the job. Returned in status
+ /// responses, where the model and system may have added or modified
+ /// keys (e.g. progress). /// /// - /// Required model identifier + /// Required model identifier
+ /// Example: my-queue-model /// /// /// Freeform model input. Passed unchanged to the model. Contents are model-specific. diff --git a/src/libs/Together/Generated/Together.QueueClient.g.cs b/src/libs/Together/Generated/Together.QueueClient.g.cs index 11e44997..7e307b10 100644 --- a/src/libs/Together/Generated/Together.QueueClient.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class QueueClient : global::Together.IQueueClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class QueueClient : global::Together.IQueueClient, global: public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class QueueClient : global::Together.IQueueClient, global: public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the QueueClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs b/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs index 7045cb97..4e32cca9 100644 --- a/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs +++ b/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RegionServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RegionServiceListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RegionServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -108,7 +121,9 @@ partial void ProcessRegionServiceListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/regions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RegionServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -359,17 +374,15 @@ partial void ProcessRegionServiceListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -406,17 +419,15 @@ partial void ProcessRegionServiceListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RegionServiceClient.g.cs b/src/libs/Together/Generated/Together.RegionServiceClient.g.cs index e259687c..b969cd15 100644 --- a/src/libs/Together/Generated/Together.RegionServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.RegionServiceClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class RegionServiceClient : global::Together.IRegionServiceClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class RegionServiceClient : global::Together.IRegionServic public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class RegionServiceClient : global::Together.IRegionServic public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the RegionServiceClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs index ab1bf90c..849b716b 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceApproveRemediationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceApproveRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -30,14 +43,14 @@ partial void PrepareRemediationServiceApproveRemediationArguments( ref string clusterId, ref string instanceId, ref string remediationId, - global::Together.CommentBody request); + global::Together.ApproveRemediationRequest request); partial void PrepareRemediationServiceApproveRemediationRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string clusterId, string instanceId, string remediationId, - global::Together.CommentBody request); + global::Together.ApproveRemediationRequest request); partial void ProcessRemediationServiceApproveRemediationResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -66,7 +79,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( string instanceId, string remediationId, - global::Together.CommentBody request, + global::Together.ApproveRemediationRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -101,7 +114,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( string instanceId, string remediationId, - global::Together.CommentBody request, + global::Together.ApproveRemediationRequest request, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -141,7 +154,9 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceApproveRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -402,17 +417,15 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -449,17 +462,15 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -481,7 +492,15 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( /// /// /// - /// Comment explaining the action. + /// Approval comment explaining the decision. + /// + /// + /// Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
+ /// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
+ /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -491,12 +510,14 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( string instanceId, string remediationId, string? comment = default, + global::Together.ApproveRemediationRequestMode? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::Together.CommentBody + var __request = new global::Together.ApproveRemediationRequest { Comment = comment, + Mode = mode, }; return await RemediationServiceApproveRemediationAsync( diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs index 220d825d..4c9fc6bc 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceCancelRemediationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceCancelRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -134,7 +147,9 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceCancelRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -388,17 +403,15 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -435,17 +448,15 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs index 477b1bc6..8a902521 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceCreateRemediationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceCreateRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -145,7 +158,9 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceCreateRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("remediation_id", remediationId) ; @@ -409,17 +424,15 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -456,17 +469,15 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -492,7 +503,10 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( /// /// Remediation mode specifies how the remediation should be performed.
/// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
- /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + /// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
+ /// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
+ /// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
+ /// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. /// /// /// User-provided reason for the remediation. diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs index 5e924f1c..5b8c673e 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceGetRemediationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceGetRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceGetRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,17 +389,15 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -421,17 +434,15 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs index b394da78..b152ef10 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceListRemediationsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceListRemediationsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -33,7 +46,8 @@ partial void PrepareRemediationServiceListRemediationsArguments( ref string? pageToken, global::System.Collections.Generic.IList? state, ref string? orderBy, - ref global::Together.RemediationServiceListRemediationsMode? mode); + global::System.Collections.Generic.IList? trigger, + global::System.Collections.Generic.IList? mode); partial void PrepareRemediationServiceListRemediationsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, @@ -43,7 +57,8 @@ partial void PrepareRemediationServiceListRemediationsRequest( string? pageToken, global::System.Collections.Generic.IList? state, string? orderBy, - global::Together.RemediationServiceListRemediationsMode? mode); + global::System.Collections.Generic.IList? trigger, + global::System.Collections.Generic.IList? mode); partial void ProcessRemediationServiceListRemediationsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -54,6 +69,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( ref string content); /// + /// List remediations
/// Lists remediations for an instance or cluster. ///
/// @@ -75,27 +91,22 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( /// - `SUCCEEDED`: Successfully completed.
/// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
- /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation. /// /// /// Order by expression. /// + /// + /// Filter by trigger type(s). Returns remediations matching any of the specified triggers. + /// /// - /// Filter by remediation mode. Returns only remediations matching the specified mode. + /// Filter by remediation mode(s). Returns remediations matching any of the specified modes. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - /// - /// import together
- /// client = together.Together(api_key="your_api_key")
- /// remediations = client.beta.clusters.remediations.list(
- /// cluster_id="cluster_id",
- /// instance_id="-",
- /// )
- /// for remediation in remediations:
- /// print(remediation) - ///
public async global::System.Threading.Tasks.Task RemediationServiceListRemediationsAsync( string clusterId, string instanceId, @@ -103,7 +114,8 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( string? pageToken = default, global::System.Collections.Generic.IList? state = default, string? orderBy = default, - global::Together.RemediationServiceListRemediationsMode? mode = default, + global::System.Collections.Generic.IList? trigger = default, + global::System.Collections.Generic.IList? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -114,6 +126,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( pageToken: pageToken, state: state, orderBy: orderBy, + trigger: trigger, mode: mode, requestOptions: requestOptions, cancellationToken: cancellationToken @@ -122,6 +135,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( return __response.Body; } /// + /// List remediations
/// Lists remediations for an instance or cluster. ///
/// @@ -143,27 +157,22 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( /// - `SUCCEEDED`: Successfully completed.
/// - `FAILED`: Failed with an error.
/// - `CANCELLED`: Cancelled by user or system.
- /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + /// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
+ /// - `QUARANTINING`: Cordoning or preparing the host before remediation.
+ /// - `QUARANTINED`: Host has been cordoned or isolated for remediation. /// /// /// Order by expression. /// + /// + /// Filter by trigger type(s). Returns remediations matching any of the specified triggers. + /// /// - /// Filter by remediation mode. Returns only remediations matching the specified mode. + /// Filter by remediation mode(s). Returns remediations matching any of the specified modes. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - /// - /// import together
- /// client = together.Together(api_key="your_api_key")
- /// remediations = client.beta.clusters.remediations.list(
- /// cluster_id="cluster_id",
- /// instance_id="-",
- /// )
- /// for remediation in remediations:
- /// print(remediation) - ///
public async global::System.Threading.Tasks.Task> RemediationServiceListRemediationsAsResponseAsync( string clusterId, string instanceId, @@ -171,7 +180,8 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( string? pageToken = default, global::System.Collections.Generic.IList? state = default, string? orderBy = default, - global::Together.RemediationServiceListRemediationsMode? mode = default, + global::System.Collections.Generic.IList? trigger = default, + global::System.Collections.Generic.IList? mode = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -185,7 +195,8 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( pageToken: ref pageToken, state: state, orderBy: ref orderBy, - mode: ref mode); + trigger: trigger, + mode: mode); var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( @@ -212,13 +223,16 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceListRemediationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) .AddOptionalParameter("page_token", pageToken) .AddOptionalParameter("state", state, selector: static x => x.ToValueString(), delimiter: ",", explode: true) .AddOptionalParameter("order_by", orderBy) - .AddOptionalParameter("mode", mode?.ToValueString()) + .AddOptionalParameter("trigger", trigger, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("mode", mode, selector: static x => x.ToValueString(), delimiter: ",", explode: true) ; var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -266,6 +280,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( pageToken: pageToken, state: state, orderBy: orderBy, + trigger: trigger, mode: mode); return __httpRequest; @@ -477,17 +492,15 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -524,17 +537,15 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs index 11e875c6..48e3f3da 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceRejectRemediationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RemediationServiceRejectRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -141,7 +154,9 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RemediationServiceRejectRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -402,17 +417,15 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -449,17 +462,15 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs index 9696ad7e..a3353085 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class RemediationServiceClient : global::Together.IRemediationServiceClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class RemediationServiceClient : global::Together.IRemedia public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class RemediationServiceClient : global::Together.IRemedia public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the RemediationServiceClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs b/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs index 3577c6e0..30a987ae 100644 --- a/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs +++ b/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RerankClient { + private static readonly global::Together.AutoSDKServer[] s_RerankServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RerankSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -181,7 +194,9 @@ partial void ProcessRerankResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/rerank", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_RerankServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -432,18 +447,17 @@ partial void ProcessRerankResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -470,18 +484,17 @@ partial void ProcessRerankResponseContent( __exception_401 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // NotFound if ((int)__response.StatusCode == 404) @@ -508,18 +521,17 @@ partial void ProcessRerankResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // RateLimit if ((int)__response.StatusCode == 429) @@ -546,18 +558,17 @@ partial void ProcessRerankResponseContent( __exception_429 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Overloaded if ((int)__response.StatusCode == 503) @@ -584,18 +595,17 @@ partial void ProcessRerankResponseContent( __exception_503 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Timeout if ((int)__response.StatusCode == 504) @@ -622,18 +632,17 @@ partial void ProcessRerankResponseContent( __exception_504 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_504, - statusCode: __response.StatusCode) - { - ResponseBody = __content_504, - ResponseObject = __value_504, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_504, + responseObject: __value_504, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -667,17 +676,15 @@ partial void ProcessRerankResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -714,17 +721,15 @@ partial void ProcessRerankResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RerankClient.g.cs b/src/libs/Together/Generated/Together.RerankClient.g.cs index 8bf3393c..6c149f36 100644 --- a/src/libs/Together/Generated/Together.RerankClient.g.cs +++ b/src/libs/Together/Generated/Together.RerankClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class RerankClient : global::Together.IRerankClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class RerankClient : global::Together.IRerankClient, globa public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class RerankClient : global::Together.IRerankClient, globa public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the RerankClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs index da672b69..6e50a309 100644 --- a/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CreateInferenceCheckpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateInferenceCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessCreateInferenceCheckpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/inference-checkpoint", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateInferenceCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessCreateInferenceCheckpointResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -400,17 +414,15 @@ partial void ProcessCreateInferenceCheckpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -447,17 +459,15 @@ partial void ProcessCreateInferenceCheckpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs new file mode 100644 index 00000000..5fc752d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs @@ -0,0 +1,532 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_CreateModelResourcesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_CreateModelResourcesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_CreateModelResourcesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_CreateModelResourcesSecurityRequirement0, + }; + partial void PrepareCreateModelResourcesArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.RlCreateModelResourcesRequest request); + partial void PrepareCreateModelResourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.RlCreateModelResourcesRequest request); + partial void ProcessCreateModelResourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateModelResourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateModelResourcesAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateModelResourcesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateModelResourcesAsResponseAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateModelResourcesArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateModelResourcesSecurityRequirements, + operationName: "CreateModelResourcesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/rl/model-resources", + baseUri: ResolveBaseUri( + servers: s_CreateModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateModelResourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateModelResources", + methodName: "CreateModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateModelResources", + methodName: "CreateModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateModelResources", + methodName: "CreateModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + 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::Together.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); + ProcessCreateModelResourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateModelResources", + methodName: "CreateModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateModelResources", + methodName: "CreateModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessCreateModelResourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlModelResources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlModelResources.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create model resources
+ /// Provisions a standalone model resource that training sessions can attach to. + ///
+ /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout to provision. + /// + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Optimizer configuration for this resource. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateModelResourcesAsync( + string baseModel, + global::Together.RlComputeConfigCreateRequest? computeConfig = default, + bool? loraEnabled = default, + global::Together.RlOptimizerConfig? optimizerConfig = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RlCreateModelResourcesRequest + { + BaseModel = baseModel, + ComputeConfig = computeConfig, + LoraEnabled = loraEnabled, + OptimizerConfig = optimizerConfig, + }; + + return await CreateModelResourcesAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs index e85f0da9..5985a36c 100644 --- a/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CreateTrainingCheckpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateTrainingCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessCreateTrainingCheckpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/training-checkpoint", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateTrainingCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessCreateTrainingCheckpointResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -400,17 +414,15 @@ partial void ProcessCreateTrainingCheckpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -447,17 +459,15 @@ partial void ProcessCreateTrainingCheckpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs b/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs new file mode 100644 index 00000000..24c29d68 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs @@ -0,0 +1,537 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_CustomForwardBackwardServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_CustomForwardBackwardSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_CustomForwardBackwardSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_CustomForwardBackwardSecurityRequirement0, + }; + partial void PrepareCustomForwardBackwardArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId, + global::Together.RlCustomForwardBackwardBody request); + partial void PrepareCustomForwardBackwardRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId, + global::Together.RlCustomForwardBackwardBody request); + partial void ProcessCustomForwardBackwardResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCustomForwardBackwardResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session 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 CustomForwardBackwardAsync( + string sessionId, + + global::Together.RlCustomForwardBackwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CustomForwardBackwardAsResponseAsync( + sessionId: sessionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session 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> CustomForwardBackwardAsResponseAsync( + string sessionId, + + global::Together.RlCustomForwardBackwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCustomForwardBackwardArguments( + httpClient: HttpClient, + sessionId: ref sessionId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CustomForwardBackwardSecurityRequirements, + operationName: "CustomForwardBackwardAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/training-sessions/{sessionId}/operations/custom-forward-backward", + baseUri: ResolveBaseUri( + servers: s_CustomForwardBackwardServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCustomForwardBackwardRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CustomForwardBackward", + methodName: "CustomForwardBackwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CustomForwardBackward", + methodName: "CustomForwardBackwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CustomForwardBackward", + methodName: "CustomForwardBackwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + 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::Together.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); + ProcessCustomForwardBackwardResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CustomForwardBackward", + methodName: "CustomForwardBackwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CustomForwardBackward", + methodName: "CustomForwardBackwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessCustomForwardBackwardResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlCustomForwardBackwardOperation.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlCustomForwardBackwardOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Custom forward-backward pass
+ /// Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + ///
+ /// + /// Training session ID + /// + /// + /// Batch of training samples + /// + /// + /// Per-sample per-token gradients of the loss with respect to log-probabilities + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CustomForwardBackwardAsync( + string sessionId, + global::System.Collections.Generic.IList samples, + global::System.Collections.Generic.IList gradients, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RlCustomForwardBackwardBody + { + Samples = samples, + Gradients = gradients, + }; + + return await CustomForwardBackwardAsync( + sessionId: sessionId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs index 1acc8707..cbe7ac75 100644 --- a/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_DownloadCheckpointServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DownloadCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -124,7 +137,9 @@ partial void ProcessDownloadCheckpointResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/checkpoints/{id}/download", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DownloadCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("variant", variant.ToValueString()) ; @@ -373,18 +388,17 @@ partial void ProcessDownloadCheckpointResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -418,17 +432,15 @@ partial void ProcessDownloadCheckpointResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -465,17 +477,15 @@ partial void ProcessDownloadCheckpointResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs b/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs new file mode 100644 index 00000000..745cc29b --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs @@ -0,0 +1,532 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_EstimateModelResourcesCostServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_EstimateModelResourcesCostSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_EstimateModelResourcesCostSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_EstimateModelResourcesCostSecurityRequirement0, + }; + partial void PrepareEstimateModelResourcesCostArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.RlCreateModelResourcesRequest request); + partial void PrepareEstimateModelResourcesCostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.RlCreateModelResourcesRequest request); + partial void ProcessEstimateModelResourcesCostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEstimateModelResourcesCostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating 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 EstimateModelResourcesCostAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EstimateModelResourcesCostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating 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> EstimateModelResourcesCostAsResponseAsync( + + global::Together.RlCreateModelResourcesRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEstimateModelResourcesCostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EstimateModelResourcesCostSecurityRequirements, + operationName: "EstimateModelResourcesCostAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/rl/model-resources/estimate-cost", + baseUri: ResolveBaseUri( + servers: s_EstimateModelResourcesCostServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEstimateModelResourcesCostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EstimateModelResourcesCost", + methodName: "EstimateModelResourcesCostAsync", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EstimateModelResourcesCost", + methodName: "EstimateModelResourcesCostAsync", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EstimateModelResourcesCost", + methodName: "EstimateModelResourcesCostAsync", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", + 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::Together.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); + ProcessEstimateModelResourcesCostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EstimateModelResourcesCost", + methodName: "EstimateModelResourcesCostAsync", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EstimateModelResourcesCost", + methodName: "EstimateModelResourcesCostAsync", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessEstimateModelResourcesCostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlModelResourcesEstimateCostResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlModelResourcesEstimateCostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Estimate on-demand model resource cost
+ /// Estimates a model resource's on-demand hourly price without creating it. + ///
+ /// + /// Base model to provision the resource for
+ /// Example: Qwen/Qwen3-0.6B + /// + /// + /// Compute layout to provision. + /// + /// + /// Whether the resource hosts LoRA sessions or a single full-weight session
+ /// Default Value: true
+ /// Example: true + /// + /// + /// Optimizer configuration for this resource. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EstimateModelResourcesCostAsync( + string baseModel, + global::Together.RlComputeConfigCreateRequest? computeConfig = default, + bool? loraEnabled = default, + global::Together.RlOptimizerConfig? optimizerConfig = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RlCreateModelResourcesRequest + { + BaseModel = baseModel, + ComputeConfig = computeConfig, + LoraEnabled = loraEnabled, + OptimizerConfig = optimizerConfig, + }; + + return await EstimateModelResourcesCostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RlClient.Forward.g.cs b/src/libs/Together/Generated/Together.RlClient.Forward.g.cs new file mode 100644 index 00000000..0d204232 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.Forward.g.cs @@ -0,0 +1,532 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_ForwardServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ForwardSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ForwardSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ForwardSecurityRequirement0, + }; + partial void PrepareForwardArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId, + global::Together.RlForwardBody request); + partial void PrepareForwardRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId, + global::Together.RlForwardBody request); + partial void ProcessForwardResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessForwardResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session 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 ForwardAsync( + string sessionId, + + global::Together.RlForwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ForwardAsResponseAsync( + sessionId: sessionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session 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> ForwardAsResponseAsync( + string sessionId, + + global::Together.RlForwardBody request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareForwardArguments( + httpClient: HttpClient, + sessionId: ref sessionId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ForwardSecurityRequirements, + operationName: "ForwardAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/training-sessions/{sessionId}/operations/forward", + baseUri: ResolveBaseUri( + servers: s_ForwardServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareForwardRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Forward", + methodName: "ForwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Forward", + methodName: "ForwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Forward", + methodName: "ForwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward\"", + 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::Together.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); + ProcessForwardResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Forward", + methodName: "ForwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Forward", + methodName: "ForwardAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward\"", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessForwardResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlForwardOperation.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlForwardOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Forward pass
+ /// Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + ///
+ /// + /// Training session ID + /// + /// + /// Batch of training samples for which to compute per-token log-probabilities + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ForwardAsync( + string sessionId, + global::System.Collections.Generic.IList samples, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RlForwardBody + { + Samples = samples, + }; + + return await ForwardAsync( + sessionId: sessionId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs b/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs index 21e4cd6b..fb361cae 100644 --- a/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ForwardBackwardServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ForwardBackwardSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -123,7 +136,9 @@ partial void ProcessForwardBackwardResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/forward-backward", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ForwardBackwardServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -375,18 +390,17 @@ partial void ProcessForwardBackwardResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -420,17 +434,15 @@ partial void ProcessForwardBackwardResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -467,17 +479,15 @@ partial void ProcessForwardBackwardResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs new file mode 100644 index 00000000..7dc59c20 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs @@ -0,0 +1,495 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_GetCustomForwardBackwardOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_GetCustomForwardBackwardOperationSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_GetCustomForwardBackwardOperationSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_GetCustomForwardBackwardOperationSecurityRequirement0, + }; + partial void PrepareGetCustomForwardBackwardOperationArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId, + ref string operationId); + partial void PrepareGetCustomForwardBackwardOperationRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId, + string operationId); + partial void ProcessGetCustomForwardBackwardOperationResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetCustomForwardBackwardOperationResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get custom forward-backward operation
+ /// Retrieves the current status and result of a custom forward-backward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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 GetCustomForwardBackwardOperationAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetCustomForwardBackwardOperationAsResponseAsync( + sessionId: sessionId, + operationId: operationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get custom forward-backward operation
+ /// Retrieves the current status and result of a custom forward-backward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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> GetCustomForwardBackwardOperationAsResponseAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetCustomForwardBackwardOperationArguments( + httpClient: HttpClient, + sessionId: ref sessionId, + operationId: ref operationId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetCustomForwardBackwardOperationSecurityRequirements, + operationName: "GetCustomForwardBackwardOperationAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetCustomForwardBackwardOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetCustomForwardBackwardOperationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!, + operationId: operationId!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCustomForwardBackwardOperation", + methodName: "GetCustomForwardBackwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCustomForwardBackwardOperation", + methodName: "GetCustomForwardBackwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCustomForwardBackwardOperation", + methodName: "GetCustomForwardBackwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + httpMethod: "GET", + 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::Together.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); + ProcessGetCustomForwardBackwardOperationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCustomForwardBackwardOperation", + methodName: "GetCustomForwardBackwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCustomForwardBackwardOperation", + methodName: "GetCustomForwardBackwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + httpMethod: "GET", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessGetCustomForwardBackwardOperationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlCustomForwardBackwardOperation.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlCustomForwardBackwardOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs index 77721454..88becca0 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetForwardBackwardOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetForwardBackwardOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetForwardBackwardOperationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetForwardBackwardOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessGetForwardBackwardOperationResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -413,17 +427,15 @@ partial void ProcessGetForwardBackwardOperationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -460,17 +472,15 @@ partial void ProcessGetForwardBackwardOperationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetForwardOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetForwardOperation.g.cs new file mode 100644 index 00000000..38885b15 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.GetForwardOperation.g.cs @@ -0,0 +1,495 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_GetForwardOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_GetForwardOperationSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_GetForwardOperationSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_GetForwardOperationSecurityRequirement0, + }; + partial void PrepareGetForwardOperationArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId, + ref string operationId); + partial void PrepareGetForwardOperationRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId, + string operationId); + partial void ProcessGetForwardOperationResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetForwardOperationResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get forward operation
+ /// Retrieves the current status and result of a forward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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 GetForwardOperationAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetForwardOperationAsResponseAsync( + sessionId: sessionId, + operationId: operationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get forward operation
+ /// Retrieves the current status and result of a forward operation. + ///
+ /// + /// Training session ID + /// + /// + /// Operation 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> GetForwardOperationAsResponseAsync( + string sessionId, + string operationId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetForwardOperationArguments( + httpClient: HttpClient, + sessionId: ref sessionId, + operationId: ref operationId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetForwardOperationSecurityRequirements, + operationName: "GetForwardOperationAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/training-sessions/{sessionId}/operations/forward/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetForwardOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetForwardOperationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!, + operationId: operationId!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetForwardOperation", + methodName: "GetForwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetForwardOperation", + methodName: "GetForwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetForwardOperation", + methodName: "GetForwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward/{operationId}\"", + httpMethod: "GET", + 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::Together.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); + ProcessGetForwardOperationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetForwardOperation", + methodName: "GetForwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward/{operationId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetForwardOperation", + methodName: "GetForwardOperationAsync", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward/{operationId}\"", + httpMethod: "GET", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessGetForwardOperationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlForwardOperation.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlForwardOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs index bf96a287..d3d28743 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetInferenceCheckpointOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetInferenceCheckpointOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetInferenceCheckpointOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -413,17 +427,15 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -460,17 +472,15 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs new file mode 100644 index 00000000..20b51e59 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs @@ -0,0 +1,482 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_GetModelResourcesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_GetModelResourcesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_GetModelResourcesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_GetModelResourcesSecurityRequirement0, + }; + partial void PrepareGetModelResourcesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelResourcesId); + partial void PrepareGetModelResourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelResourcesId); + partial void ProcessGetModelResourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetModelResourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get model resources
+ /// Gets a model resource by its ID and returns its details. + ///
+ /// + /// ID of the model resource + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetModelResourcesAsync( + string modelResourcesId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetModelResourcesAsResponseAsync( + modelResourcesId: modelResourcesId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get model resources
+ /// Gets a model resource by its ID and returns its details. + ///
+ /// + /// ID of the model resource + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetModelResourcesAsResponseAsync( + string modelResourcesId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetModelResourcesArguments( + httpClient: HttpClient, + modelResourcesId: ref modelResourcesId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetModelResourcesSecurityRequirements, + operationName: "GetModelResourcesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/model-resources/{modelResourcesId}", + baseUri: ResolveBaseUri( + servers: s_GetModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetModelResourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelResourcesId: modelResourcesId!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelResources", + methodName: "GetModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelResources", + methodName: "GetModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelResources", + methodName: "GetModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", + httpMethod: "GET", + 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::Together.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); + ProcessGetModelResourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelResources", + methodName: "GetModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelResources", + methodName: "GetModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", + httpMethod: "GET", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessGetModelResourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlModelResources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlModelResources.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs index 4c119130..312bdc1e 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetOptimStepOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetOptimStepOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetOptimStepOperationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetOptimStepOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessGetOptimStepOperationResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -413,17 +427,15 @@ partial void ProcessGetOptimStepOperationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -460,17 +472,15 @@ partial void ProcessGetOptimStepOperationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs b/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs index f6572813..cc0cb19e 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetSampleServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetSampleSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetSampleResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/sample/{operationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetSampleServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessGetSampleResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -413,17 +427,15 @@ partial void ProcessGetSampleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -460,17 +472,15 @@ partial void ProcessGetSampleResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs index c3809df8..9e27b3ad 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetTrainingCheckpointOperationServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetTrainingCheckpointOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetTrainingCheckpointOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -368,18 +383,17 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -413,17 +427,15 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -460,17 +472,15 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs index 2638820e..bcbea160 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetTrainingSessionServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetTrainingSessionResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessGetTrainingSessionResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -400,17 +414,15 @@ partial void ProcessGetTrainingSessionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -447,17 +459,15 @@ partial void ProcessGetTrainingSessionResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs new file mode 100644 index 00000000..70d693c8 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs @@ -0,0 +1,529 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListModelResourcesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ListModelResourcesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ListModelResourcesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListModelResourcesSecurityRequirement0, + }; + partial void PrepareListModelResourcesArguments( + global::System.Net.Http.HttpClient httpClient, + global::System.Collections.Generic.IList? status, + ref int? limit, + ref string? after, + ref string? createdBy); + partial void PrepareListModelResourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Collections.Generic.IList? status, + int? limit, + string? after, + string? createdBy); + partial void ProcessListModelResourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListModelResourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List model resources
+ /// Lists the caller's model resources. + ///
+ /// + /// Status filters. When omitted, resources in any status are returned. + /// + /// + /// Maximum number of resources to return (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for pagination + /// + /// + /// Filter resources in the current project by the creator ID. Pass "me" to show resources you created. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListModelResourcesAsync( + global::System.Collections.Generic.IList? status = default, + int? limit = default, + string? after = default, + string? createdBy = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListModelResourcesAsResponseAsync( + status: status, + limit: limit, + after: after, + createdBy: createdBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List model resources
+ /// Lists the caller's model resources. + ///
+ /// + /// Status filters. When omitted, resources in any status are returned. + /// + /// + /// Maximum number of resources to return (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for pagination + /// + /// + /// Filter resources in the current project by the creator ID. Pass "me" to show resources you created. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListModelResourcesAsResponseAsync( + global::System.Collections.Generic.IList? status = default, + int? limit = default, + string? after = default, + string? createdBy = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListModelResourcesArguments( + httpClient: HttpClient, + status: status, + limit: ref limit, + after: ref after, + createdBy: ref createdBy); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListModelResourcesSecurityRequirements, + operationName: "ListModelResourcesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/rl/model-resources", + baseUri: ResolveBaseUri( + servers: s_ListModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("status", status, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("created_by", createdBy) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListModelResourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + status: status, + limit: limit, + after: after, + createdBy: createdBy); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListModelResources", + methodName: "ListModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListModelResources", + methodName: "ListModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListModelResources", + methodName: "ListModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + httpMethod: "GET", + 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::Together.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); + ProcessListModelResourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListModelResources", + methodName: "ListModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListModelResources", + methodName: "ListModelResourcesAsync", + pathTemplate: "\"/rl/model-resources\"", + httpMethod: "GET", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessListModelResourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlModelResourcesListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlModelResourcesListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.ListSupportedModels.g.cs b/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs new file mode 100644 index 00000000..a3cb4613 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs @@ -0,0 +1,506 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListSupportedModelsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ListSupportedModelsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ListSupportedModelsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListSupportedModelsSecurityRequirement0, + }; + partial void PrepareListSupportedModelsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListSupportedModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListSupportedModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListSupportedModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List supported models
+ /// Returns the models supported by the RL service and their limits for training/sampling operations. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListSupportedModelsAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListSupportedModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List supported models
+ /// Returns the models supported by the RL service and their limits for training/sampling operations. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListSupportedModelsAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListSupportedModelsArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListSupportedModelsSecurityRequirements, + operationName: "ListSupportedModelsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/rl/supported-models", + baseUri: ResolveBaseUri( + servers: s_ListSupportedModelsServers, + defaultBaseUrl: "https://api.together.ai/v1")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListSupportedModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSupportedModels", + methodName: "ListSupportedModelsAsync", + pathTemplate: "\"/rl/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSupportedModels", + methodName: "ListSupportedModelsAsync", + pathTemplate: "\"/rl/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSupportedModels", + methodName: "ListSupportedModelsAsync", + pathTemplate: "\"/rl/supported-models\"", + httpMethod: "GET", + 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::Together.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); + ProcessListSupportedModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSupportedModels", + methodName: "ListSupportedModelsAsync", + pathTemplate: "\"/rl/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSupportedModels", + methodName: "ListSupportedModelsAsync", + pathTemplate: "\"/rl/supported-models\"", + httpMethod: "GET", + 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); + } + // Rate limit exceeded. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Together.ErrorData? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessListSupportedModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlSupportedModelsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlSupportedModelsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs b/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs index df86cb24..bc8af07f 100644 --- a/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ListTrainingSessionsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_ListTrainingSessionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -27,15 +40,19 @@ public partial class RlClient }; partial void PrepareListTrainingSessionsArguments( global::System.Net.Http.HttpClient httpClient, - ref global::Together.RlTrainingSessionStatus? status, + global::System.Collections.Generic.IList? status, ref int? limit, - ref string? after); + ref string? after, + ref string? modelResourcesId, + ref string? createdBy); partial void PrepareListTrainingSessionsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Together.RlTrainingSessionStatus? status, + global::System.Collections.Generic.IList? status, int? limit, - string? after); + string? after, + string? modelResourcesId, + string? createdBy); partial void ProcessListTrainingSessionsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -50,8 +67,7 @@ partial void ProcessListTrainingSessionsResponseContent( /// Lists all training sessions. ///
/// - /// Status of the training sessions to list
- /// Default Value: TRAINING_SESSION_STATUS_UNSPECIFIED + /// Status filters. When omitted, sessions in any status are returned. /// /// /// Maximum number of sessions to return (1-100)
@@ -60,13 +76,21 @@ partial void ProcessListTrainingSessionsResponseContent( /// /// Cursor for pagination (ID of the last session from the previous page) /// + /// + /// Filter sessions by the model resource they are attached to + /// + /// + /// Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ListTrainingSessionsAsync( - global::Together.RlTrainingSessionStatus? status = default, + global::System.Collections.Generic.IList? status = default, int? limit = default, string? after = default, + string? modelResourcesId = default, + string? createdBy = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,6 +98,8 @@ partial void ProcessListTrainingSessionsResponseContent( status: status, limit: limit, after: after, + modelResourcesId: modelResourcesId, + createdBy: createdBy, requestOptions: requestOptions, cancellationToken: cancellationToken ).ConfigureAwait(false); @@ -85,8 +111,7 @@ partial void ProcessListTrainingSessionsResponseContent( /// Lists all training sessions. ///
/// - /// Status of the training sessions to list
- /// Default Value: TRAINING_SESSION_STATUS_UNSPECIFIED + /// Status filters. When omitted, sessions in any status are returned. /// /// /// Maximum number of sessions to return (1-100)
@@ -95,13 +120,21 @@ partial void ProcessListTrainingSessionsResponseContent( /// /// Cursor for pagination (ID of the last session from the previous page) /// + /// + /// Filter sessions by the model resource they are attached to + /// + /// + /// Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ListTrainingSessionsAsResponseAsync( - global::Together.RlTrainingSessionStatus? status = default, + global::System.Collections.Generic.IList? status = default, int? limit = default, string? after = default, + string? modelResourcesId = default, + string? createdBy = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -109,9 +142,11 @@ partial void ProcessListTrainingSessionsResponseContent( client: HttpClient); PrepareListTrainingSessionsArguments( httpClient: HttpClient, - status: ref status, + status: status, limit: ref limit, - after: ref after); + after: ref after, + modelResourcesId: ref modelResourcesId, + createdBy: ref createdBy); var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( @@ -138,11 +173,15 @@ partial void ProcessListTrainingSessionsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/rl/training-sessions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_ListTrainingSessionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder - .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("status", status, selector: static x => x.ToValueString(), delimiter: ",", explode: true) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) + .AddOptionalParameter("model_resources_id", modelResourcesId) + .AddOptionalParameter("created_by", createdBy) ; var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,7 +225,9 @@ partial void ProcessListTrainingSessionsResponseContent( httpRequestMessage: __httpRequest, status: status, limit: limit, - after: after); + after: after, + modelResourcesId: modelResourcesId, + createdBy: createdBy); return __httpRequest; } @@ -390,18 +431,17 @@ partial void ProcessListTrainingSessionsResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -435,17 +475,15 @@ partial void ProcessListTrainingSessionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -482,17 +520,15 @@ partial void ProcessListTrainingSessionsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs b/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs index 7db2cb3d..3192e136 100644 --- a/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_OptimStepServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_OptimStepSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -123,7 +136,9 @@ partial void ProcessOptimStepResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/optim-step", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_OptimStepServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -375,18 +390,17 @@ partial void ProcessOptimStepResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -420,17 +434,15 @@ partial void ProcessOptimStepResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -467,17 +479,15 @@ partial void ProcessOptimStepResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -495,28 +505,39 @@ partial void ProcessOptimStepResponseContent( /// /// Training session ID /// - /// - /// Learning rate for this step.
- /// Default Value: 0.0001
- /// Example: 0.0001 + /// + /// How the trainer's updated weights are propagated to the generator after this optimizer step. See `WeightSyncType` for accepted values.
+ /// Default Value: WEIGHT_SYNC_TYPE_UNSPECIFIED + /// + /// + /// Maximum gradient norm for this step, gradients across all model parameters are clipped to this value.
+ /// Default Value: 1.0
+ /// Example: 10 /// /// - /// AdamW optimizer parameters + /// Per-step AdamW optimizer overrides. + /// + /// + /// Per-step Muon optimizer overrides /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task OptimStepAsync( string sessionId, - float? learningRate = default, + global::Together.RlWeightSyncType weightSyncType = global::Together.RlWeightSyncType.WeightSyncTypeUnspecified, + float? maxGradNorm = default, global::Together.RlAdamWOptimizerParams? adamwParams = default, + global::Together.RlMuonOptimizerParams? muonParams = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Together.RlOptimStepBody { - LearningRate = learningRate, + WeightSyncType = weightSyncType, + MaxGradNorm = maxGradNorm, AdamwParams = adamwParams, + MuonParams = muonParams, }; return await OptimStepAsync( diff --git a/src/libs/Together/Generated/Together.RlClient.Sample.g.cs b/src/libs/Together/Generated/Together.RlClient.Sample.g.cs index 11acf2da..bf6392b3 100644 --- a/src/libs/Together/Generated/Together.RlClient.Sample.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.Sample.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_SampleServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SampleSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -123,7 +136,9 @@ partial void ProcessSampleResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/operations/sample", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SampleServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -375,18 +390,17 @@ partial void ProcessSampleResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -420,17 +434,15 @@ partial void ProcessSampleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -467,17 +479,15 @@ partial void ProcessSampleResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -513,7 +523,7 @@ partial void ProcessSampleResponseContent( string sessionId, global::System.Collections.Generic.IList prompts, global::Together.RlSamplingParams? samplingParams = default, - long? numSamples = default, + int? numSamples = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { diff --git a/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs index f15b5164..a44e8a0a 100644 --- a/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_StartTrainingSessionServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_StartTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -111,7 +124,9 @@ partial void ProcessStartTrainingSessionResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/rl/training-sessions", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_StartTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -362,18 +377,17 @@ partial void ProcessStartTrainingSessionResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -407,17 +421,15 @@ partial void ProcessStartTrainingSessionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +466,15 @@ partial void ProcessStartTrainingSessionResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -479,38 +489,38 @@ partial void ProcessStartTrainingSessionResponseContent( /// Create training session
/// Creates a training session and returns its details. ///
- /// - /// Base model to use for the training session
- /// Example: meta-llama/Meta-Llama-3-8B-Instruct - /// /// /// Checkpoint ID to resume from
/// Example: 123e4567-e89b-12d3-a456-426614174000 /// - /// - /// Type of the training session. Defaults to TRAINER_AND_GENERATOR when unspecified. TRAINER_ONLY provisions only the trainer and rejects sample requests.
- /// Default Value: SESSION_TYPE_TRAINER_AND_GENERATOR + /// + /// HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id.
+ /// Example: your-org/llama-3-8b-finetuned /// /// - /// LoRA adapter configuration + /// LoRA adapter configuration for the session + /// + /// + /// Model resource to attach the session to. The session runs on that resource's GPU pods.
+ /// Example: 123e4567-e89b-12d3-a456-426614174000 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task StartTrainingSessionAsync( - string baseModel, + string modelResourcesId, string? resumeFromCheckpointId = default, - global::Together.RlSessionType? type = default, + string? resumeFromHfCheckpoint = default, global::Together.RlLoraConfig? loraConfig = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Together.RlStartTrainingSessionRequest { - BaseModel = baseModel, ResumeFromCheckpointId = resumeFromCheckpointId, - Type = type, + ResumeFromHfCheckpoint = resumeFromHfCheckpoint, LoraConfig = loraConfig, + ModelResourcesId = modelResourcesId, }; return await StartTrainingSessionAsync( diff --git a/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs new file mode 100644 index 00000000..5339eb26 --- /dev/null +++ b/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs @@ -0,0 +1,500 @@ + +#nullable enable + +namespace Together +{ + public partial class RlClient + { + + private static readonly global::Together.AutoSDKServer[] s_StopModelResourcesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_StopModelResourcesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_StopModelResourcesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_StopModelResourcesSecurityRequirement0, + }; + partial void PrepareStopModelResourcesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelResourcesId, + ref bool? force); + partial void PrepareStopModelResourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelResourcesId, + bool? force); + partial void ProcessStopModelResourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessStopModelResourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Stop model resources
+ /// Stops every session attached to the resource and tears down its GPU pods. + ///
+ /// + /// ID of the model resource + /// + /// + /// Stop the resource even if active training sessions are attached
+ /// 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 StopModelResourcesAsync( + string modelResourcesId, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StopModelResourcesAsResponseAsync( + modelResourcesId: modelResourcesId, + force: force, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Stop model resources
+ /// Stops every session attached to the resource and tears down its GPU pods. + ///
+ /// + /// ID of the model resource + /// + /// + /// Stop the resource even if active training sessions are attached
+ /// 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> StopModelResourcesAsResponseAsync( + string modelResourcesId, + bool? force = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStopModelResourcesArguments( + httpClient: HttpClient, + modelResourcesId: ref modelResourcesId, + force: ref force); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StopModelResourcesSecurityRequirements, + operationName: "StopModelResourcesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/rl/model-resources/{modelResourcesId}/stop", + baseUri: ResolveBaseUri( + servers: s_StopModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStopModelResourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelResourcesId: modelResourcesId!, + force: force); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopModelResources", + methodName: "StopModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopModelResources", + methodName: "StopModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopModelResources", + methodName: "StopModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", + 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::Together.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); + ProcessStopModelResourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopModelResources", + methodName: "StopModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopModelResources", + methodName: "StopModelResourcesAsync", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", + 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); + } + // An unexpected error response. + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessStopModelResourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RlModelResources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.RlModelResources.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RlClient.StopTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs index 3b2eb815..e0d341d2 100644 --- a/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_StopTrainingSessionServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_StopTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessStopTrainingSessionResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/rl/training-sessions/{sessionId}/stop", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_StopTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessStopTrainingSessionResponseContent( __exception_default = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_default ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_default, - statusCode: __response.StatusCode) - { - ResponseBody = __content_default, - ResponseObject = __value_default, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_default, + responseObject: __value_default, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -400,17 +414,15 @@ partial void ProcessStopTrainingSessionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -447,17 +459,15 @@ partial void ProcessStopTrainingSessionResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.RlClient.g.cs b/src/libs/Together/Generated/Together.RlClient.g.cs index c3d99a40..57d8f6ee 100644 --- a/src/libs/Together/Generated/Together.RlClient.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class RlClient : global::Together.IRlClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class RlClient : global::Together.IRlClient, global::Syste public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class RlClient : global::Together.IRlClient, global::Syste public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the RlClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs new file mode 100644 index 00000000..20e0ade0 --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs @@ -0,0 +1,573 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceCancelRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceCancelRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceCancelRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceCancelRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceCancelRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + global::Together.DeCancelRolloutRequest request); + partial void PrepareRolloutServiceCancelRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + global::Together.DeCancelRolloutRequest request); + partial void ProcessRolloutServiceCancelRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceCancelRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeCancelRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceCancelRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceCancelRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeCancelRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceCancelRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceCancelRolloutSecurityRequirements, + operationName: "RolloutServiceCancelRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceCancelRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceCancelRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCancelRollout", + methodName: "RolloutServiceCancelRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCancelRollout", + methodName: "RolloutServiceCancelRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCancelRollout", + methodName: "RolloutServiceCancelRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + 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::Together.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); + ProcessRolloutServiceCancelRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCancelRollout", + methodName: "RolloutServiceCancelRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCancelRollout", + methodName: "RolloutServiceCancelRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceCancelRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Cancel a rollout
+ /// Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Required human-readable reason recorded in the rollout audit trail. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( + string projectId, + string endpointId, + string id, + string reason, + string? etag = default, + global::Together.DeCancelRolloutRequestDisposition? disposition = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCancelRolloutRequest + { + Reason = reason, + Etag = etag, + Disposition = disposition, + }; + + return await RolloutServiceCancelRolloutAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs new file mode 100644 index 00000000..a5b04eed --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs @@ -0,0 +1,590 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceCreateRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceCreateRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceCreateRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceCreateRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceCreateRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + global::Together.DeCreateRolloutRequest request); + partial void PrepareRolloutServiceCreateRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + global::Together.DeCreateRolloutRequest request); + partial void ProcessRolloutServiceCreateRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceCreateRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( + string projectId, + string endpointId, + + global::Together.DeCreateRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceCreateRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceCreateRolloutAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceCreateRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceCreateRolloutSecurityRequirements, + operationName: "RolloutServiceCreateRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceCreateRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceCreateRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCreateRollout", + methodName: "RolloutServiceCreateRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCreateRollout", + methodName: "RolloutServiceCreateRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCreateRollout", + methodName: "RolloutServiceCreateRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + 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::Together.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); + ProcessRolloutServiceCreateRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCreateRollout", + methodName: "RolloutServiceCreateRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceCreateRollout", + methodName: "RolloutServiceCreateRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceCreateRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a rollout
+ /// Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Deployment that traffic shifts away from. + /// + /// + /// Deployment that traffic shifts toward. + /// + /// + /// Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling. + /// + /// + /// Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling. + /// + /// + /// Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen. + /// + /// + /// Optional metric gates evaluated after each step's soak. + /// + /// + /// Optional per-step soak duration before the metric gate runs. + /// + /// + /// Optional policy for the source deployment after completion. + /// + /// + /// Optional final replica count for the source deployment after completion. + /// + /// + /// Optional final replica count for the target deployment after completion. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( + string projectId, + string endpointId, + string sourceDeploymentId, + string targetDeploymentId, + global::Together.DeCanaryConfig? canary = default, + global::Together.DeBlueGreenConfig? blueGreen = default, + global::Together.DeRollingConfig? rolling = default, + global::System.Collections.Generic.IList? metrics = default, + string? stabilizationWindow = default, + global::Together.DeCreateRolloutRequestSourceCleanup? sourceCleanup = default, + int? finalSourceReplicas = default, + int? finalTargetReplicas = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateRolloutRequest + { + SourceDeploymentId = sourceDeploymentId, + TargetDeploymentId = targetDeploymentId, + Canary = canary, + BlueGreen = blueGreen, + Rolling = rolling, + Metrics = metrics, + StabilizationWindow = stabilizationWindow, + SourceCleanup = sourceCleanup, + FinalSourceReplicas = finalSourceReplicas, + FinalTargetReplicas = finalTargetReplicas, + }; + + return await RolloutServiceCreateRolloutAsync( + projectId: projectId, + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs new file mode 100644 index 00000000..44ecfced --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs @@ -0,0 +1,519 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceDeleteRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceDeleteRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceDeleteRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceDeleteRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceDeleteRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? etag); + partial void PrepareRolloutServiceDeleteRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? etag); + partial void ProcessRolloutServiceDeleteRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceDeleteRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a rollout
+ /// Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceDeleteRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceDeleteRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a rollout
+ /// Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceDeleteRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceDeleteRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceDeleteRolloutSecurityRequirements, + operationName: "RolloutServiceDeleteRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceDeleteRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceDeleteRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceDeleteRollout", + methodName: "RolloutServiceDeleteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceDeleteRollout", + methodName: "RolloutServiceDeleteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceDeleteRollout", + methodName: "RolloutServiceDeleteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessRolloutServiceDeleteRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceDeleteRollout", + methodName: "RolloutServiceDeleteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceDeleteRollout", + methodName: "RolloutServiceDeleteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceDeleteRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs new file mode 100644 index 00000000..74f4f0cf --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceGetRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceGetRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceGetRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceGetRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceGetRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id); + partial void PrepareRolloutServiceGetRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id); + partial void ProcessRolloutServiceGetRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceGetRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a rollout
+ /// Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceGetRolloutAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceGetRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a rollout
+ /// Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceGetRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceGetRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceGetRolloutSecurityRequirements, + operationName: "RolloutServiceGetRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceGetRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceGetRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceGetRollout", + methodName: "RolloutServiceGetRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceGetRollout", + methodName: "RolloutServiceGetRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceGetRollout", + methodName: "RolloutServiceGetRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessRolloutServiceGetRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceGetRollout", + methodName: "RolloutServiceGetRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceGetRollout", + methodName: "RolloutServiceGetRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceGetRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs new file mode 100644 index 00000000..66380724 --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs @@ -0,0 +1,534 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceListRolloutsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceListRolloutsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceListRolloutsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceListRolloutsSecurityRequirement0, + }; + partial void PrepareRolloutServiceListRolloutsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref int? limit, + ref string? after, + ref global::Together.RolloutServiceListRolloutsFilter? filter); + partial void PrepareRolloutServiceListRolloutsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + int? limit, + string? after, + global::Together.RolloutServiceListRolloutsFilter? filter); + partial void ProcessRolloutServiceListRolloutsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceListRolloutsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List endpoint rollouts
+ /// Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of rollouts to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous rollout list response. + /// + /// + /// Narrow results to active or terminal rollouts. Omit to list all rollouts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceListRolloutsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.RolloutServiceListRolloutsFilter? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceListRolloutsAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + limit: limit, + after: after, + filter: filter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List endpoint rollouts
+ /// Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of rollouts to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous rollout list response. + /// + /// + /// Narrow results to active or terminal rollouts. Omit to list all rollouts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceListRolloutsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + global::Together.RolloutServiceListRolloutsFilter? filter = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceListRolloutsArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + limit: ref limit, + after: ref after, + filter: ref filter); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceListRolloutsSecurityRequirements, + operationName: "RolloutServiceListRolloutsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceListRolloutsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("filter", filter?.ToValueString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceListRolloutsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + limit: limit, + after: after, + filter: filter); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceListRollouts", + methodName: "RolloutServiceListRolloutsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceListRollouts", + methodName: "RolloutServiceListRolloutsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceListRollouts", + methodName: "RolloutServiceListRolloutsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + httpMethod: "GET", + 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::Together.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); + ProcessRolloutServiceListRolloutsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceListRollouts", + methodName: "RolloutServiceListRolloutsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceListRollouts", + methodName: "RolloutServiceListRolloutsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceListRolloutsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListRolloutsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListRolloutsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs new file mode 100644 index 00000000..79a900a4 --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs @@ -0,0 +1,568 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServicePauseRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServicePauseRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServicePauseRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServicePauseRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServicePauseRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + global::Together.DePauseRolloutRequest request); + partial void PrepareRolloutServicePauseRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + global::Together.DePauseRolloutRequest request); + partial void ProcessRolloutServicePauseRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServicePauseRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePauseRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServicePauseRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServicePauseRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePauseRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRolloutServicePauseRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServicePauseRolloutSecurityRequirements, + operationName: "RolloutServicePauseRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause", + baseUri: ResolveBaseUri( + servers: s_RolloutServicePauseRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServicePauseRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePauseRollout", + methodName: "RolloutServicePauseRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePauseRollout", + methodName: "RolloutServicePauseRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePauseRollout", + methodName: "RolloutServicePauseRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + 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::Together.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); + ProcessRolloutServicePauseRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePauseRollout", + methodName: "RolloutServicePauseRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePauseRollout", + methodName: "RolloutServicePauseRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServicePauseRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Pause a rollout
+ /// Pauses a running rollout at its current traffic split and records an optional reason. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// + /// Optional human-readable reason recorded on the rollout pause metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + string? reason = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DePauseRolloutRequest + { + Etag = etag, + Reason = reason, + }; + + return await RolloutServicePauseRolloutAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs new file mode 100644 index 00000000..f22293ed --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServicePromoteRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServicePromoteRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServicePromoteRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServicePromoteRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServicePromoteRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + global::Together.DePromoteRolloutRequest request); + partial void PrepareRolloutServicePromoteRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + global::Together.DePromoteRolloutRequest request); + partial void ProcessRolloutServicePromoteRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServicePromoteRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePromoteRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServicePromoteRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServicePromoteRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DePromoteRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRolloutServicePromoteRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServicePromoteRolloutSecurityRequirements, + operationName: "RolloutServicePromoteRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote", + baseUri: ResolveBaseUri( + servers: s_RolloutServicePromoteRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServicePromoteRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePromoteRollout", + methodName: "RolloutServicePromoteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePromoteRollout", + methodName: "RolloutServicePromoteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePromoteRollout", + methodName: "RolloutServicePromoteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + 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::Together.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); + ProcessRolloutServicePromoteRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePromoteRollout", + methodName: "RolloutServicePromoteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServicePromoteRollout", + methodName: "RolloutServicePromoteRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServicePromoteRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Promote a rollout
+ /// Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DePromoteRolloutRequest + { + Etag = etag, + }; + + return await RolloutServicePromoteRolloutAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs new file mode 100644 index 00000000..17df76fc --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceResumeRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceResumeRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceResumeRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceResumeRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceResumeRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + global::Together.DeResumeRolloutRequest request); + partial void PrepareRolloutServiceResumeRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + global::Together.DeResumeRolloutRequest request); + partial void ProcessRolloutServiceResumeRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceResumeRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeResumeRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceResumeRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceResumeRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + + global::Together.DeResumeRolloutRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceResumeRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceResumeRolloutSecurityRequirements, + operationName: "RolloutServiceResumeRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceResumeRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceResumeRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceResumeRollout", + methodName: "RolloutServiceResumeRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceResumeRollout", + methodName: "RolloutServiceResumeRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceResumeRollout", + methodName: "RolloutServiceResumeRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + 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::Together.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); + ProcessRolloutServiceResumeRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceResumeRollout", + methodName: "RolloutServiceResumeRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceResumeRollout", + methodName: "RolloutServiceResumeRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceResumeRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Resume a rollout
+ /// Resumes a paused rollout from its current step and traffic split. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// + /// Optional etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeResumeRolloutRequest + { + Etag = etag, + }; + + return await RolloutServiceResumeRolloutAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs new file mode 100644 index 00000000..4d3f8fca --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Together +{ + public partial class RolloutServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceStartRolloutServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_RolloutServiceStartRolloutSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_RolloutServiceStartRolloutSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RolloutServiceStartRolloutSecurityRequirement0, + }; + partial void PrepareRolloutServiceStartRolloutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id); + partial void PrepareRolloutServiceStartRolloutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id); + partial void ProcessRolloutServiceStartRolloutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRolloutServiceStartRolloutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Start a rollout
+ /// Starts a pending rollout and begins its configured traffic-shifting workflow. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RolloutServiceStartRolloutAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RolloutServiceStartRolloutAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start a rollout
+ /// Starts a pending rollout and begins its configured traffic-shifting workflow. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Rollout identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RolloutServiceStartRolloutAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRolloutServiceStartRolloutArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RolloutServiceStartRolloutSecurityRequirements, + operationName: "RolloutServiceStartRolloutAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceStartRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRolloutServiceStartRolloutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceStartRollout", + methodName: "RolloutServiceStartRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceStartRollout", + methodName: "RolloutServiceStartRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceStartRollout", + methodName: "RolloutServiceStartRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + 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::Together.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); + ProcessRolloutServiceStartRolloutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceStartRollout", + methodName: "RolloutServiceStartRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RolloutServiceStartRollout", + methodName: "RolloutServiceStartRolloutAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessRolloutServiceStartRolloutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRollout.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRollout.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.RolloutServiceClient.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs new file mode 100644 index 00000000..b7ae4b2b --- /dev/null +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class RolloutServiceClient : global::Together.IRolloutServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the RolloutServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public RolloutServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the RolloutServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public RolloutServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the RolloutServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public RolloutServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs index 83bfe99d..c9509f30 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsSecretsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateDeploymentsSecretsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -121,7 +134,9 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments/secrets", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsSecretsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -372,18 +387,17 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -410,18 +424,17 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -455,17 +468,15 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -502,17 +513,15 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs index 0c387644..be291411 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsSecretsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,7 +133,9 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -365,18 +380,17 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -403,18 +417,17 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -446,17 +459,15 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -491,17 +502,15 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs index a89f8c6c..ed55b291 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsSecretsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_EditDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -133,7 +146,9 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -385,18 +400,17 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Secret not found if ((int)__response.StatusCode == 404) @@ -423,18 +437,17 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -461,18 +474,17 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -506,17 +518,15 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -553,17 +563,15 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs index 4210646e..4c8fbf43 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsSecretsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsSecretsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessGetDeploymentsSecretsResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/deployments/secrets", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsSecretsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -354,18 +369,17 @@ partial void ProcessGetDeploymentsSecretsResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -399,17 +413,15 @@ partial void ProcessGetDeploymentsSecretsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -446,17 +458,15 @@ partial void ProcessGetDeploymentsSecretsResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs index 7cc047ba..4c9e88db 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsSecretsByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -367,18 +382,17 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -405,18 +419,17 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -450,17 +463,15 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -497,17 +508,15 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SecretsClient.g.cs b/src/libs/Together/Generated/Together.SecretsClient.g.cs index 5cd026a3..e01436d7 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class SecretsClient : global::Together.ISecretsClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class SecretsClient : global::Together.ISecretsClient, glo public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class SecretsClient : global::Together.ISecretsClient, glo public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the SecretsClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs new file mode 100644 index 00000000..b739921c --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs @@ -0,0 +1,592 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceCreateShadowExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceCreateShadowExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceCreateShadowExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceCreateShadowExperimentSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceCreateShadowExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + global::Together.DeCreateShadowExperimentRequest request); + partial void PrepareShadowExperimentServiceCreateShadowExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + global::Together.DeCreateShadowExperimentRequest request); + partial void ProcessShadowExperimentServiceCreateShadowExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( + string projectId, + string endpointId, + + global::Together.DeCreateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceCreateShadowExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + + global::Together.DeCreateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceCreateShadowExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceCreateShadowExperimentSecurityRequirements, + operationName: "ShadowExperimentServiceCreateShadowExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceCreateShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceCreateShadowExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateShadowExperiment", + methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateShadowExperiment", + methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateShadowExperiment", + methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + 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::Together.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); + ProcessShadowExperimentServiceCreateShadowExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateShadowExperiment", + methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateShadowExperiment", + methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceCreateShadowExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a shadow experiment
+ /// Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + /// + /// + /// Endpoint source and sampling configuration for the experiment. + /// + /// + /// Optional initial target deployments. At most 100 targets; manage later changes through the target APIs. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( + string projectId, + string endpointId, + string name, + global::Together.DeShadowExperimentSource source, + global::System.Collections.Generic.IList? targets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateShadowExperimentRequest + { + Name = name, + Source = source, + Targets = targets, + }; + + return await ShadowExperimentServiceCreateShadowExperimentAsync( + projectId: projectId, + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs new file mode 100644 index 00000000..b3be301d --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs @@ -0,0 +1,610 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceCreateTargetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceCreateTargetSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceCreateTargetSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceCreateTargetSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceCreateTargetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string experimentId, + global::Together.DeCreateShadowExperimentTargetRequest request); + partial void PrepareShadowExperimentServiceCreateTargetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string experimentId, + global::Together.DeCreateShadowExperimentTargetRequest request); + partial void ProcessShadowExperimentServiceCreateTargetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceCreateTargetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceCreateTargetAsync( + string projectId, + string endpointId, + string experimentId, + + global::Together.DeCreateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceCreateTargetAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + + global::Together.DeCreateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceCreateTargetArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + experimentId: ref experimentId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceCreateTargetSecurityRequirements, + operationName: "ShadowExperimentServiceCreateTargetAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceCreateTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceCreateTargetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + experimentId: experimentId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateTarget", + methodName: "ShadowExperimentServiceCreateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateTarget", + methodName: "ShadowExperimentServiceCreateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateTarget", + methodName: "ShadowExperimentServiceCreateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + 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::Together.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); + ProcessShadowExperimentServiceCreateTargetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateTarget", + methodName: "ShadowExperimentServiceCreateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceCreateTarget", + methodName: "ShadowExperimentServiceCreateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceCreateTargetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperimentTarget.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperimentTarget.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a shadow experiment target
+ /// Adds a deployment under the same endpoint as a target for mirrored requests. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Human-readable target name, unique within the shadow experiment. At most 256 characters. + /// + /// + /// Deployment under the parent endpoint that receives mirrored traffic. Exclude it from the endpoint's live traffic split. + /// + /// + /// Optional free-form target 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 ShadowExperimentServiceCreateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string name, + string targetDeploymentId, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateShadowExperimentTargetRequest + { + Name = name, + TargetDeploymentId = targetDeploymentId, + Description = description, + }; + + return await ShadowExperimentServiceCreateTargetAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs new file mode 100644 index 00000000..af91e066 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs @@ -0,0 +1,556 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceDeleteShadowExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceDeleteShadowExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceDeleteShadowExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceDeleteShadowExperimentSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceDeleteShadowExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string? etag); + partial void PrepareShadowExperimentServiceDeleteShadowExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string? etag); + partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a shadow experiment
+ /// Deletes a shadow experiment and its target records. The underlying deployments are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceDeleteShadowExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a shadow experiment
+ /// Deletes a shadow experiment and its target records. The underlying deployments are not deleted. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceDeleteShadowExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceDeleteShadowExperimentSecurityRequirements, + operationName: "ShadowExperimentServiceDeleteShadowExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceDeleteShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceDeleteShadowExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteShadowExperiment", + methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteShadowExperiment", + methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteShadowExperiment", + methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessShadowExperimentServiceDeleteShadowExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteShadowExperiment", + methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteShadowExperiment", + methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "DELETE", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs new file mode 100644 index 00000000..0b777260 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs @@ -0,0 +1,569 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceDeleteTargetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceDeleteTargetSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceDeleteTargetSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceDeleteTargetSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceDeleteTargetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string experimentId, + ref string id, + ref string? etag); + partial void PrepareShadowExperimentServiceDeleteTargetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string experimentId, + string id, + string? etag); + partial void ProcessShadowExperimentServiceDeleteTargetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a shadow experiment target
+ /// Removes a target from a shadow experiment without deleting the underlying deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceDeleteTargetAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + id: id, + etag: etag, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a shadow experiment target
+ /// Removes a target from a shadow experiment without deleting the underlying deployment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Etag for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceDeleteTargetArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + experimentId: ref experimentId, + id: ref id, + etag: ref etag); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceDeleteTargetSecurityRequirements, + operationName: "ShadowExperimentServiceDeleteTargetAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceDeleteTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("etag", etag) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceDeleteTargetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + experimentId: experimentId!, + id: id!, + etag: etag); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteTarget", + methodName: "ShadowExperimentServiceDeleteTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteTarget", + methodName: "ShadowExperimentServiceDeleteTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteTarget", + methodName: "ShadowExperimentServiceDeleteTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessShadowExperimentServiceDeleteTargetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteTarget", + methodName: "ShadowExperimentServiceDeleteTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceDeleteTarget", + methodName: "ShadowExperimentServiceDeleteTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "DELETE", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceDeleteTargetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs new file mode 100644 index 00000000..dd11b119 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs @@ -0,0 +1,540 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceGetShadowExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceGetShadowExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceGetShadowExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceGetShadowExperimentSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceGetShadowExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id); + partial void PrepareShadowExperimentServiceGetShadowExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id); + partial void ProcessShadowExperimentServiceGetShadowExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a shadow experiment
+ /// Retrieves a shadow experiment, including its sampling strategy and target deployments. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceGetShadowExperimentAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceGetShadowExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a shadow experiment
+ /// Retrieves a shadow experiment, including its sampling strategy and target deployments. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceGetShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceGetShadowExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceGetShadowExperimentSecurityRequirements, + operationName: "ShadowExperimentServiceGetShadowExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceGetShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceGetShadowExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetShadowExperiment", + methodName: "ShadowExperimentServiceGetShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetShadowExperiment", + methodName: "ShadowExperimentServiceGetShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetShadowExperiment", + methodName: "ShadowExperimentServiceGetShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessShadowExperimentServiceGetShadowExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetShadowExperiment", + methodName: "ShadowExperimentServiceGetShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetShadowExperiment", + methodName: "ShadowExperimentServiceGetShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "GET", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceGetShadowExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs new file mode 100644 index 00000000..63e8842a --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs @@ -0,0 +1,553 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceGetTargetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceGetTargetSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceGetTargetSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceGetTargetSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceGetTargetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string experimentId, + ref string id); + partial void PrepareShadowExperimentServiceGetTargetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string experimentId, + string id); + partial void ProcessShadowExperimentServiceGetTargetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceGetTargetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a shadow experiment target
+ /// Retrieves one target configured to receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceGetTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceGetTargetAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a shadow experiment target
+ /// Retrieves one target configured to receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceGetTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceGetTargetArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + experimentId: ref experimentId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceGetTargetSecurityRequirements, + operationName: "ShadowExperimentServiceGetTargetAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceGetTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceGetTargetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + experimentId: experimentId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetTarget", + methodName: "ShadowExperimentServiceGetTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetTarget", + methodName: "ShadowExperimentServiceGetTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetTarget", + methodName: "ShadowExperimentServiceGetTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessShadowExperimentServiceGetTargetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetTarget", + methodName: "ShadowExperimentServiceGetTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceGetTarget", + methodName: "ShadowExperimentServiceGetTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "GET", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceGetTargetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperimentTarget.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperimentTarget.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs new file mode 100644 index 00000000..f112b47d --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs @@ -0,0 +1,571 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceListShadowExperimentsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceListShadowExperimentsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceListShadowExperimentsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceListShadowExperimentsSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceListShadowExperimentsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref int? limit, + ref string? after, + ref bool? includeTargets); + partial void PrepareShadowExperimentServiceListShadowExperimentsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + int? limit, + string? after, + bool? includeTargets); + partial void ProcessShadowExperimentServiceListShadowExperimentsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List shadow experiments
+ /// Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of shadow experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment list response. + /// + /// + /// Whether to include target deployments in each returned shadow experiment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceListShadowExperimentsAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + bool? includeTargets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceListShadowExperimentsAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + limit: limit, + after: after, + includeTargets: includeTargets, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List shadow experiments
+ /// Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Maximum number of shadow experiments to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment list response. + /// + /// + /// Whether to include target deployments in each returned shadow experiment. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceListShadowExperimentsAsResponseAsync( + string projectId, + string endpointId, + int? limit = default, + string? after = default, + bool? includeTargets = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceListShadowExperimentsArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + limit: ref limit, + after: ref after, + includeTargets: ref includeTargets); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceListShadowExperimentsSecurityRequirements, + operationName: "ShadowExperimentServiceListShadowExperimentsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceListShadowExperimentsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + .AddOptionalParameter("includeTargets", includeTargets?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceListShadowExperimentsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + limit: limit, + after: after, + includeTargets: includeTargets); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListShadowExperiments", + methodName: "ShadowExperimentServiceListShadowExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListShadowExperiments", + methodName: "ShadowExperimentServiceListShadowExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListShadowExperiments", + methodName: "ShadowExperimentServiceListShadowExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + httpMethod: "GET", + 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::Together.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); + ProcessShadowExperimentServiceListShadowExperimentsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListShadowExperiments", + methodName: "ShadowExperimentServiceListShadowExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListShadowExperiments", + methodName: "ShadowExperimentServiceListShadowExperimentsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + httpMethod: "GET", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceListShadowExperimentsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListShadowExperimentsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListShadowExperimentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs new file mode 100644 index 00000000..e3ae6302 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs @@ -0,0 +1,570 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceListTargetsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceListTargetsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceListTargetsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceListTargetsSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceListTargetsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string experimentId, + ref int? limit, + ref string? after); + partial void PrepareShadowExperimentServiceListTargetsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string experimentId, + int? limit, + string? after); + partial void ProcessShadowExperimentServiceListTargetsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceListTargetsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List shadow experiment targets
+ /// Lists the deployments that receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Maximum number of targets to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment target list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceListTargetsAsync( + string projectId, + string endpointId, + string experimentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceListTargetsAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List shadow experiment targets
+ /// Lists the deployments that receive mirrored requests from a shadow experiment. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Maximum number of targets to return. Max 500, defaults to 50. + /// + /// + /// Cursor from a previous shadow experiment target list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceListTargetsAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceListTargetsArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + experimentId: ref experimentId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceListTargetsSecurityRequirements, + operationName: "ShadowExperimentServiceListTargetsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceListTargetsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceListTargetsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + experimentId: experimentId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListTargets", + methodName: "ShadowExperimentServiceListTargetsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListTargets", + methodName: "ShadowExperimentServiceListTargetsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListTargets", + methodName: "ShadowExperimentServiceListTargetsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + httpMethod: "GET", + 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::Together.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); + ProcessShadowExperimentServiceListTargetsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListTargets", + methodName: "ShadowExperimentServiceListTargetsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceListTargets", + methodName: "ShadowExperimentServiceListTargetsAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + httpMethod: "GET", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceListTargetsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListShadowExperimentTargetsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListShadowExperimentTargetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs new file mode 100644 index 00000000..96e63df2 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs @@ -0,0 +1,631 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceUpdateShadowExperimentServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceUpdateShadowExperimentSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceUpdateShadowExperimentSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceUpdateShadowExperimentSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceUpdateShadowExperimentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string id, + ref string updateMask, + global::Together.DeUpdateShadowExperimentRequest request); + partial void PrepareShadowExperimentServiceUpdateShadowExperimentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string id, + string updateMask, + global::Together.DeUpdateShadowExperimentRequest request); + partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceUpdateShadowExperimentAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + updateMask: updateMask, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateShadowExperimentAsResponseAsync( + string projectId, + string endpointId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceUpdateShadowExperimentArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceUpdateShadowExperimentSecurityRequirements, + operationName: "ShadowExperimentServiceUpdateShadowExperimentAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceUpdateShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddRequiredParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceUpdateShadowExperimentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + id: id!, + updateMask: updateMask!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateShadowExperiment", + methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateShadowExperiment", + methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateShadowExperiment", + methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessShadowExperimentServiceUpdateShadowExperimentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateShadowExperiment", + methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateShadowExperiment", + methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + httpMethod: "PATCH", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperiment.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a shadow experiment
+ /// Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Required fields to update, such as description or source. + /// + /// + /// Updated free-form description. + /// + /// + /// Updated endpoint sampling configuration. Source updates require etag in the request body. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( + string projectId, + string endpointId, + string id, + string updateMask, + string? description = default, + global::Together.DeShadowExperimentSource? source = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateShadowExperimentRequest + { + Description = description, + Source = source, + Etag = etag, + }; + + return await ShadowExperimentServiceUpdateShadowExperimentAsync( + projectId: projectId, + endpointId: endpointId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs new file mode 100644 index 00000000..e2a94bde --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs @@ -0,0 +1,654 @@ + +#nullable enable + +namespace Together +{ + public partial class ShadowExperimentServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceUpdateTargetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_ShadowExperimentServiceUpdateTargetSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_ShadowExperimentServiceUpdateTargetSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ShadowExperimentServiceUpdateTargetSecurityRequirement0, + }; + partial void PrepareShadowExperimentServiceUpdateTargetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string endpointId, + ref string experimentId, + ref string id, + ref string updateMask, + global::Together.DeUpdateShadowExperimentTargetRequest request); + partial void PrepareShadowExperimentServiceUpdateTargetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + global::Together.DeUpdateShadowExperimentTargetRequest request); + partial void ProcessShadowExperimentServiceUpdateTargetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `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 ShadowExperimentServiceUpdateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ShadowExperimentServiceUpdateTargetAsResponseAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + id: id, + updateMask: updateMask, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `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> ShadowExperimentServiceUpdateTargetAsResponseAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + + global::Together.DeUpdateShadowExperimentTargetRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareShadowExperimentServiceUpdateTargetArguments( + httpClient: HttpClient, + projectId: ref projectId, + endpointId: ref endpointId, + experimentId: ref experimentId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ShadowExperimentServiceUpdateTargetSecurityRequirements, + operationName: "ShadowExperimentServiceUpdateTargetAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceUpdateTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddRequiredParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareShadowExperimentServiceUpdateTargetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + endpointId: endpointId!, + experimentId: experimentId!, + id: id!, + updateMask: updateMask!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateTarget", + methodName: "ShadowExperimentServiceUpdateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateTarget", + methodName: "ShadowExperimentServiceUpdateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateTarget", + methodName: "ShadowExperimentServiceUpdateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessShadowExperimentServiceUpdateTargetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateTarget", + methodName: "ShadowExperimentServiceUpdateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ShadowExperimentServiceUpdateTarget", + methodName: "ShadowExperimentServiceUpdateTargetAsync", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + httpMethod: "PATCH", + 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); + } + // Invalid request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessShadowExperimentServiceUpdateTargetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeShadowExperimentTarget.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeShadowExperimentTarget.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a shadow experiment target
+ /// Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + ///
+ /// + /// Project identifier. + /// + /// + /// Endpoint identifier. + /// + /// + /// Shadow experiment identifier. + /// + /// + /// Shadow experiment target identifier. + /// + /// + /// Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `description`. + /// + /// + /// Updated human-readable target name. + /// + /// + /// Replacement deployment under the parent endpoint. Exclude it from the endpoint's live traffic split. + /// + /// + /// Updated free-form target description. + /// + /// + /// Opaque version tag from a prior read for optimistic concurrency. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateTargetAsync( + string projectId, + string endpointId, + string experimentId, + string id, + string updateMask, + string? name = default, + string? targetDeploymentId = default, + string? description = default, + string? etag = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateShadowExperimentTargetRequest + { + Name = name, + TargetDeploymentId = targetDeploymentId, + Description = description, + Etag = etag, + }; + + return await ShadowExperimentServiceUpdateTargetAsync( + projectId: projectId, + endpointId: endpointId, + experimentId: experimentId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs new file mode 100644 index 00000000..b1d2e216 --- /dev/null +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ShadowExperimentServiceClient : global::Together.IShadowExperimentServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ShadowExperimentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ShadowExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ShadowExperimentServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ShadowExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ShadowExperimentServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ShadowExperimentServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs index 1703c9ac..3d2ffba6 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceCreateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SharedVolumeServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -133,7 +146,9 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -391,17 +406,15 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -438,17 +451,15 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -477,6 +488,9 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( /// /// When true, the shared volume is not deleted when the cluster is decommissioned. /// + /// + /// Project ID that will own the volume. When omitted, the caller's default project is used. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -485,6 +499,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( long sizeTib, string region, bool? isLifecycleIndependent = default, + string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -494,6 +509,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( SizeTib = sizeTib, Region = region, IsLifecycleIndependent = isLifecycleIndependent, + ProjectId = projectId, }; return await SharedVolumeServiceCreateAsync( diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs index 4539c594..61afe49d 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceDeleteServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SharedVolumeServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/storage/volumes/{volumeId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,17 +389,15 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -421,17 +434,15 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs index b65ffc4b..7508434b 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceGetServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SharedVolumeServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessSharedVolumeServiceGetResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/compute/clusters/storage/volumes/{volumeId}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -374,17 +389,15 @@ partial void ProcessSharedVolumeServiceGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -421,17 +434,15 @@ partial void ProcessSharedVolumeServiceGetResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs index eed2bf14..e964e80c 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceListServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SharedVolumeServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -126,9 +139,11 @@ partial void ProcessSharedVolumeServiceListResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder - .AddOptionalParameter("project_id", projectId) + .AddOptionalParameter("projectId", projectId) ; var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -381,17 +396,15 @@ partial void ProcessSharedVolumeServiceListResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -428,17 +441,15 @@ partial void ProcessSharedVolumeServiceListResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs index 0149eb4f..09649f0e 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceUpdateServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_SharedVolumeServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -129,7 +142,9 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -387,17 +402,15 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -434,17 +447,15 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs index 053c48bb..a6083f85 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class SharedVolumeServiceClient : global::Together.ISharedVolumeServiceClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class SharedVolumeServiceClient : global::Together.IShared public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class SharedVolumeServiceClient : global::Together.IShared public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the SharedVolumeServiceClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs new file mode 100644 index 00000000..7f5e97cf --- /dev/null +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs @@ -0,0 +1,477 @@ + +#nullable enable + +namespace Together +{ + public partial class SupportedModelsServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_SupportedModelsServiceGetSupportedModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_SupportedModelsServiceGetSupportedModelSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_SupportedModelsServiceGetSupportedModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_SupportedModelsServiceGetSupportedModelSecurityRequirement0, + }; + partial void PrepareSupportedModelsServiceGetSupportedModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareSupportedModelsServiceGetSupportedModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessSupportedModelsServiceGetSupportedModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a supported model
+ /// Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. + ///
+ /// + /// Supported model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SupportedModelsServiceGetSupportedModelAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SupportedModelsServiceGetSupportedModelAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a supported model
+ /// Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. + ///
+ /// + /// Supported model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SupportedModelsServiceGetSupportedModelAsResponseAsync( + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareSupportedModelsServiceGetSupportedModelArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SupportedModelsServiceGetSupportedModelSecurityRequirements, + operationName: "SupportedModelsServiceGetSupportedModelAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/supported-models/{id}", + baseUri: ResolveBaseUri( + servers: s_SupportedModelsServiceGetSupportedModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSupportedModelsServiceGetSupportedModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceGetSupportedModel", + methodName: "SupportedModelsServiceGetSupportedModelAsync", + pathTemplate: "$\"/supported-models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceGetSupportedModel", + methodName: "SupportedModelsServiceGetSupportedModelAsync", + pathTemplate: "$\"/supported-models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceGetSupportedModel", + methodName: "SupportedModelsServiceGetSupportedModelAsync", + pathTemplate: "$\"/supported-models/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessSupportedModelsServiceGetSupportedModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceGetSupportedModel", + methodName: "SupportedModelsServiceGetSupportedModelAsync", + pathTemplate: "$\"/supported-models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceGetSupportedModel", + methodName: "SupportedModelsServiceGetSupportedModelAsync", + pathTemplate: "$\"/supported-models/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessSupportedModelsServiceGetSupportedModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeSupportedModel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeSupportedModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs new file mode 100644 index 00000000..d3aa9772 --- /dev/null +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs @@ -0,0 +1,536 @@ + +#nullable enable + +namespace Together +{ + public partial class SupportedModelsServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_SupportedModelsServiceListSupportedModelsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_SupportedModelsServiceListSupportedModelsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_SupportedModelsServiceListSupportedModelsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_SupportedModelsServiceListSupportedModelsSecurityRequirement0, + }; + partial void PrepareSupportedModelsServiceListSupportedModelsArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::Together.SupportedModelsServiceListSupportedModelsModality? modality, + ref global::Together.SupportedModelsServiceListSupportedModelsProduct? product, + ref string? search, + ref int? limit, + ref string? after); + partial void PrepareSupportedModelsServiceListSupportedModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.SupportedModelsServiceListSupportedModelsModality? modality, + global::Together.SupportedModelsServiceListSupportedModelsProduct? product, + string? search, + int? limit, + string? after); + partial void ProcessSupportedModelsServiceListSupportedModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List supported models
+ /// Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. + ///
+ /// + /// Filter models by input modality. + /// + /// + /// Filter models by product surface. + /// + /// + /// Case-insensitive search across model IDs, names, and descriptions. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous supported-model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SupportedModelsServiceListSupportedModelsAsync( + global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, + global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, + string? search = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SupportedModelsServiceListSupportedModelsAsResponseAsync( + modality: modality, + product: product, + search: search, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List supported models
+ /// Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. + ///
+ /// + /// Filter models by input modality. + /// + /// + /// Filter models by product surface. + /// + /// + /// Case-insensitive search across model IDs, names, and descriptions. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous supported-model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SupportedModelsServiceListSupportedModelsAsResponseAsync( + global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, + global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, + string? search = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareSupportedModelsServiceListSupportedModelsArguments( + httpClient: HttpClient, + modality: ref modality, + product: ref product, + search: ref search, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SupportedModelsServiceListSupportedModelsSecurityRequirements, + operationName: "SupportedModelsServiceListSupportedModelsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: "/supported-models", + baseUri: ResolveBaseUri( + servers: s_SupportedModelsServiceListSupportedModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("modality", modality?.ToValueString()) + .AddOptionalParameter("product", product?.ToValueString()) + .AddOptionalParameter("search", search) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSupportedModelsServiceListSupportedModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modality: modality, + product: product, + search: search, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceListSupportedModels", + methodName: "SupportedModelsServiceListSupportedModelsAsync", + pathTemplate: "\"/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceListSupportedModels", + methodName: "SupportedModelsServiceListSupportedModelsAsync", + pathTemplate: "\"/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceListSupportedModels", + methodName: "SupportedModelsServiceListSupportedModelsAsync", + pathTemplate: "\"/supported-models\"", + httpMethod: "GET", + 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::Together.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); + ProcessSupportedModelsServiceListSupportedModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceListSupportedModels", + methodName: "SupportedModelsServiceListSupportedModelsAsync", + pathTemplate: "\"/supported-models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SupportedModelsServiceListSupportedModels", + methodName: "SupportedModelsServiceListSupportedModelsAsync", + pathTemplate: "\"/supported-models\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessSupportedModelsServiceListSupportedModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListSupportedModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListSupportedModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.SupportedModelsServiceClient.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs new file mode 100644 index 00000000..8411fec8 --- /dev/null +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class SupportedModelsServiceClient : global::Together.ISupportedModelsServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the SupportedModelsServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SupportedModelsServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SupportedModelsServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SupportedModelsServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SupportedModelsServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SupportedModelsServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.TogetherClient.g.cs b/src/libs/Together/Generated/Together.TogetherClient.g.cs index fbdce084..541220aa 100644 --- a/src/libs/Together/Generated/Together.TogetherClient.g.cs +++ b/src/libs/Together/Generated/Together.TogetherClient.g.cs @@ -11,7 +11,7 @@ namespace Together public sealed partial class TogetherClient : global::Together.ITogetherClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -43,6 +43,26 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + /// + /// + /// + public ABExperimentServiceClient ABExperimentService => new ABExperimentServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + + /// + /// + /// + public AccountClient Account => new AccountClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -93,6 +113,26 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public ConfigServiceClient ConfigService => new ConfigServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + + /// + /// + /// + public DeploymentServiceClient DeploymentService => new DeploymentServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -133,6 +173,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public EndpointServiceClient EndpointService => new EndpointServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -203,6 +253,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public HealthCheckServiceClient HealthCheckService => new HealthCheckServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -223,6 +283,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public InstanceTypeServiceClient InstanceTypeService => new InstanceTypeServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -243,6 +313,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public PlacementProfileServiceClient PlacementProfileService => new PlacementProfileServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -293,6 +373,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public RolloutServiceClient RolloutService => new RolloutServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -303,6 +393,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public ShadowExperimentServiceClient ShadowExperimentService => new ShadowExperimentServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -313,6 +413,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public SupportedModelsServiceClient SupportedModelsService => new SupportedModelsServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -333,6 +443,16 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public VolumeServiceClient VolumeService => new VolumeServiceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -347,9 +467,14 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] { new global::Together.AutoSDKServer( id: "https-api-together-ai-v1", - name: "api.together.ai v1", + name: "Default environment for APIs", url: "https://api.together.ai/v1", - description: ""), + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), new global::Together.AutoSDKServer( id: "https-api-together-ai-v2", name: "api.together.ai v2", diff --git a/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs b/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs index b45c3141..be8289d0 100644 --- a/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs @@ -8,6 +8,14 @@ namespace Together public partial class VideoClient { + private static readonly global::Together.AutoSDKServer[] s_CreateVideoServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + private static readonly global::Together.EndPointSecurityRequirement s_CreateVideoSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -139,7 +147,9 @@ partial void ProcessCreateVideoResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/videos", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/v2", global::System.UriKind.RelativeOrAbsolute)); + baseUri: ResolveBaseUri( + servers: s_CreateVideoServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -397,17 +407,15 @@ partial void ProcessCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -444,17 +452,15 @@ partial void ProcessCreateVideoResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs b/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs index 54dcd22c..8e333fed 100644 --- a/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VideoClient { + private static readonly global::Together.AutoSDKServer[] s_RetrieveVideoServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + private static readonly global::Together.EndPointSecurityRequirement s_RetrieveVideoSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -130,7 +138,9 @@ partial void ProcessRetrieveVideoResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/videos/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/v2", global::System.UriKind.RelativeOrAbsolute)); + baseUri: ResolveBaseUri( + servers: s_RetrieveVideoServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -371,17 +381,16 @@ partial void ProcessRetrieveVideoResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // if ((int)__response.StatusCode == 404) @@ -404,17 +413,16 @@ partial void ProcessRetrieveVideoResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -448,17 +456,15 @@ partial void ProcessRetrieveVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -495,17 +501,15 @@ partial void ProcessRetrieveVideoResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VideoClient.g.cs b/src/libs/Together/Generated/Together.VideoClient.g.cs index 93ed9dc1..62a4d160 100644 --- a/src/libs/Together/Generated/Together.VideoClient.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.g.cs @@ -140,5 +140,36 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs b/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs index ed830b6b..4a544d33 100644 --- a/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs +++ b/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VoicesClient { + private static readonly global::Together.AutoSDKServer[] s_FetchVoicesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_FetchVoicesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -118,7 +131,9 @@ partial void ProcessFetchVoicesResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: "/voices", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_FetchVoicesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -369,17 +384,15 @@ partial void ProcessFetchVoicesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -416,17 +429,15 @@ partial void ProcessFetchVoicesResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VoicesClient.g.cs b/src/libs/Together/Generated/Together.VoicesClient.g.cs index a35dbb3b..2a5083b3 100644 --- a/src/libs/Together/Generated/Together.VoicesClient.g.cs +++ b/src/libs/Together/Generated/Together.VoicesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class VoicesClient : global::Together.IVoicesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class VoicesClient : global::Together.IVoicesClient, globa public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class VoicesClient : global::Together.IVoicesClient, globa public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the VoicesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs new file mode 100644 index 00000000..e560fe18 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs @@ -0,0 +1,542 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceCreateModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceCreateModelSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceCreateModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceCreateModelSecurityRequirement0, + }; + partial void PrepareVolumeServiceCreateModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + global::Together.DeCreateModelRequest request); + partial void PrepareVolumeServiceCreateModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + global::Together.DeCreateModelRequest request); + partial void ProcessVolumeServiceCreateModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceCreateModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( + string projectId, + + global::Together.DeCreateModelRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceCreateModelAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceCreateModelAsResponseAsync( + string projectId, + + global::Together.DeCreateModelRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceCreateModelArguments( + httpClient: HttpClient, + projectId: ref projectId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceCreateModelSecurityRequirements, + operationName: "VolumeServiceCreateModelAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceCreateModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceCreateModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateModel", + methodName: "VolumeServiceCreateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateModel", + methodName: "VolumeServiceCreateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateModel", + methodName: "VolumeServiceCreateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + 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::Together.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); + ProcessVolumeServiceCreateModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateModel", + methodName: "VolumeServiceCreateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateModel", + methodName: "VolumeServiceCreateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceCreateModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeModel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a model
+ /// Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + ///
+ /// + /// Project identifier. + /// + /// + /// Name for the custom model. May be bare or qualified as `<project_slug>/<model_name>`; a supplied project slug must match the project in the request path. + /// + /// + /// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted. + /// + /// + /// Human-readable description of the model and its intended use. + /// + /// + /// ID of the supported base model from which this model was derived. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( + string projectId, + string name, + string type, + string baseModelId, + string? description = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateModelRequest + { + Name = name, + Type = type, + Description = description, + BaseModelId = baseModelId, + }; + + return await VolumeServiceCreateModelAsync( + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs new file mode 100644 index 00000000..6b6223cf --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs @@ -0,0 +1,537 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceCreateRemoteModelUploadServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceCreateRemoteModelUploadSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceCreateRemoteModelUploadSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceCreateRemoteModelUploadSecurityRequirement0, + }; + partial void PrepareVolumeServiceCreateRemoteModelUploadArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + global::Together.DeCreateRemoteUploadSpec request); + partial void PrepareVolumeServiceCreateRemoteModelUploadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + global::Together.DeCreateRemoteUploadSpec request); + partial void ProcessVolumeServiceCreateRemoteModelUploadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceCreateRemoteModelUploadAsync( + string projectId, + + global::Together.DeCreateRemoteUploadSpec request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceCreateRemoteModelUploadAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceCreateRemoteModelUploadAsResponseAsync( + string projectId, + + global::Together.DeCreateRemoteUploadSpec request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceCreateRemoteModelUploadArguments( + httpClient: HttpClient, + projectId: ref projectId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceCreateRemoteModelUploadSecurityRequirements, + operationName: "VolumeServiceCreateRemoteModelUploadAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/uploads", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceCreateRemoteModelUploadServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceCreateRemoteModelUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateRemoteModelUpload", + methodName: "VolumeServiceCreateRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateRemoteModelUpload", + methodName: "VolumeServiceCreateRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateRemoteModelUpload", + methodName: "VolumeServiceCreateRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + 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::Together.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); + ProcessVolumeServiceCreateRemoteModelUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateRemoteModelUpload", + methodName: "VolumeServiceCreateRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceCreateRemoteModelUpload", + methodName: "VolumeServiceCreateRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceCreateRemoteModelUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRemoteUpload.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRemoteUpload.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a remote model upload
+ /// Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + ///
+ /// + /// Project identifier. + /// + /// + /// ID of the registered model that will receive the imported files. + /// + /// + /// Hugging Face repository URL or presigned archive URL to import. + /// + /// + /// Optional source credential used to access a private remote location. The value is write-only and is not 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 VolumeServiceCreateRemoteModelUploadAsync( + string projectId, + string modelId, + string remoteUrl, + string? token = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeCreateRemoteUploadSpec + { + ModelId = modelId, + RemoteUrl = remoteUrl, + Token = token, + }; + + return await VolumeServiceCreateRemoteModelUploadAsync( + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs new file mode 100644 index 00000000..7876eebe --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceDeleteModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceDeleteModelSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceDeleteModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceDeleteModelSecurityRequirement0, + }; + partial void PrepareVolumeServiceDeleteModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareVolumeServiceDeleteModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessVolumeServiceDeleteModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceDeleteModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a model
+ /// Permanently deletes a custom model resource. The model must not be in use by an active deployment. + ///
+ /// + /// ID of the project that owns the model. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceDeleteModelAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceDeleteModelAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a model
+ /// Permanently deletes a custom model resource. The model must not be in use by an active deployment. + ///
+ /// + /// ID of the project that owns the model. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceDeleteModelAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceDeleteModelArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceDeleteModelSecurityRequirements, + operationName: "VolumeServiceDeleteModelAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceDeleteModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceDeleteModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceDeleteModel", + methodName: "VolumeServiceDeleteModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceDeleteModel", + methodName: "VolumeServiceDeleteModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceDeleteModel", + methodName: "VolumeServiceDeleteModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "DELETE", + 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::Together.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); + ProcessVolumeServiceDeleteModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceDeleteModel", + methodName: "VolumeServiceDeleteModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "DELETE", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceDeleteModel", + methodName: "VolumeServiceDeleteModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "DELETE", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceDeleteModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs new file mode 100644 index 00000000..90fda802 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceGetModelSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceGetModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceGetModelSecurityRequirement0, + }; + partial void PrepareVolumeServiceGetModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareVolumeServiceGetModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessVolumeServiceGetModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceGetModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a model
+ /// Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceGetModelAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceGetModelAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a model
+ /// Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceGetModelAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceGetModelArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceGetModelSecurityRequirements, + operationName: "VolumeServiceGetModelAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceGetModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetModel", + methodName: "VolumeServiceGetModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetModel", + methodName: "VolumeServiceGetModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetModel", + methodName: "VolumeServiceGetModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceGetModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetModel", + methodName: "VolumeServiceGetModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetModel", + methodName: "VolumeServiceGetModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceGetModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeModel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs new file mode 100644 index 00000000..c9c4a3e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetRemoteModelUploadServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceGetRemoteModelUploadSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceGetRemoteModelUploadSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceGetRemoteModelUploadSecurityRequirement0, + }; + partial void PrepareVolumeServiceGetRemoteModelUploadArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareVolumeServiceGetRemoteModelUploadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessVolumeServiceGetRemoteModelUploadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a remote model upload
+ /// Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceGetRemoteModelUploadAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceGetRemoteModelUploadAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a remote model upload
+ /// Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceGetRemoteModelUploadAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceGetRemoteModelUploadArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceGetRemoteModelUploadSecurityRequirements, + operationName: "VolumeServiceGetRemoteModelUploadAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/uploads/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetRemoteModelUploadServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceGetRemoteModelUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRemoteModelUpload", + methodName: "VolumeServiceGetRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRemoteModelUpload", + methodName: "VolumeServiceGetRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRemoteModelUpload", + methodName: "VolumeServiceGetRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceGetRemoteModelUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRemoteModelUpload", + methodName: "VolumeServiceGetRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRemoteModelUpload", + methodName: "VolumeServiceGetRemoteModelUploadAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceGetRemoteModelUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeRemoteUpload.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeRemoteUpload.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs new file mode 100644 index 00000000..ef7a9cd8 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetRevisionByModelTypeServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceGetRevisionByModelTypeSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceGetRevisionByModelTypeSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceGetRevisionByModelTypeSecurityRequirement0, + }; + partial void PrepareVolumeServiceGetRevisionByModelTypeArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string revisionId); + partial void PrepareVolumeServiceGetRevisionByModelTypeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string revisionId); + partial void ProcessVolumeServiceGetRevisionByModelTypeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a model volume revision
+ /// Retrieves metadata for one immutable revision of a custom model's files. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceGetRevisionByModelTypeAsync( + string projectId, + string id, + string revisionId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceGetRevisionByModelTypeAsResponseAsync( + projectId: projectId, + id: id, + revisionId: revisionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a model volume revision
+ /// Retrieves metadata for one immutable revision of a custom model's files. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceGetRevisionByModelTypeAsResponseAsync( + string projectId, + string id, + string revisionId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceGetRevisionByModelTypeArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + revisionId: ref revisionId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceGetRevisionByModelTypeSecurityRequirements, + operationName: "VolumeServiceGetRevisionByModelTypeAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}/revisions/{revisionId}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetRevisionByModelTypeServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceGetRevisionByModelTypeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + revisionId: revisionId!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRevisionByModelType", + methodName: "VolumeServiceGetRevisionByModelTypeAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRevisionByModelType", + methodName: "VolumeServiceGetRevisionByModelTypeAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRevisionByModelType", + methodName: "VolumeServiceGetRevisionByModelTypeAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceGetRevisionByModelTypeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRevisionByModelType", + methodName: "VolumeServiceGetRevisionByModelTypeAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceGetRevisionByModelType", + methodName: "VolumeServiceGetRevisionByModelTypeAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceGetRevisionByModelTypeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListRevisionsResponseRevision.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListRevisionsResponseRevision.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs new file mode 100644 index 00000000..f5061c80 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs @@ -0,0 +1,506 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelFilesServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListModelFilesSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListModelFilesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListModelFilesSecurityRequirement0, + }; + partial void PrepareVolumeServiceListModelFilesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string? revisionId); + partial void PrepareVolumeServiceListModelFilesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string? revisionId); + partial void ProcessVolumeServiceListModelFilesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListModelFilesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List model files
+ /// Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier to read from. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListModelFilesAsync( + string projectId, + string id, + string? revisionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListModelFilesAsResponseAsync( + projectId: projectId, + id: id, + revisionId: revisionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List model files
+ /// Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Revision identifier to read from. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListModelFilesAsResponseAsync( + string projectId, + string id, + string? revisionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListModelFilesArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + revisionId: ref revisionId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListModelFilesSecurityRequirements, + operationName: "VolumeServiceListModelFilesAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}/files", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelFilesServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("revisionId", revisionId) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListModelFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + revisionId: revisionId); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelFiles", + methodName: "VolumeServiceListModelFilesAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelFiles", + methodName: "VolumeServiceListModelFilesAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelFiles", + methodName: "VolumeServiceListModelFilesAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListModelFilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelFiles", + methodName: "VolumeServiceListModelFilesAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelFiles", + methodName: "VolumeServiceListModelFilesAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListModelFilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListFilesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs new file mode 100644 index 00000000..e5ac52b6 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs @@ -0,0 +1,490 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelRevisionsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListModelRevisionsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListModelRevisionsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListModelRevisionsSecurityRequirement0, + }; + partial void PrepareVolumeServiceListModelRevisionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id); + partial void PrepareVolumeServiceListModelRevisionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id); + partial void ProcessVolumeServiceListModelRevisionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListModelRevisionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List model revisions
+ /// Lists the immutable file revisions available for a custom model, newest first. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListModelRevisionsAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListModelRevisionsAsResponseAsync( + projectId: projectId, + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List model revisions
+ /// Lists the immutable file revisions available for a custom model, newest first. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListModelRevisionsAsResponseAsync( + string projectId, + string id, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListModelRevisionsArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListModelRevisionsSecurityRequirements, + operationName: "VolumeServiceListModelRevisionsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}/revisions", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelRevisionsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListModelRevisionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelRevisions", + methodName: "VolumeServiceListModelRevisionsAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelRevisions", + methodName: "VolumeServiceListModelRevisionsAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelRevisions", + methodName: "VolumeServiceListModelRevisionsAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListModelRevisionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelRevisions", + methodName: "VolumeServiceListModelRevisionsAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModelRevisions", + methodName: "VolumeServiceListModelRevisionsAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListModelRevisionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListRevisionsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListRevisionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs new file mode 100644 index 00000000..4b724366 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListModelsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListModelsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListModelsSecurityRequirement0, + }; + partial void PrepareVolumeServiceListModelsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref global::Together.VolumeServiceListModelsVisibility? visibility, + ref string? organizationId, + ref int? limit, + ref string? after); + partial void PrepareVolumeServiceListModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + global::Together.VolumeServiceListModelsVisibility? visibility, + string? organizationId, + int? limit, + string? after); + partial void ProcessVolumeServiceListModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List project models
+ /// Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. + ///
+ /// + /// Project identifier. + /// + /// + /// Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + /// + /// + /// Organization whose shared models should be included. Defaults to the authenticated project's organization. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListModelsAsync( + string projectId, + global::Together.VolumeServiceListModelsVisibility? visibility = default, + string? organizationId = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListModelsAsResponseAsync( + projectId: projectId, + visibility: visibility, + organizationId: organizationId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List project models
+ /// Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. + ///
+ /// + /// Project identifier. + /// + /// + /// Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + /// + /// + /// Organization whose shared models should be included. Defaults to the authenticated project's organization. + /// + /// + /// Maximum number of models to return. + /// + /// + /// Cursor from a previous model list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListModelsAsResponseAsync( + string projectId, + global::Together.VolumeServiceListModelsVisibility? visibility = default, + string? organizationId = default, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListModelsArguments( + httpClient: HttpClient, + projectId: ref projectId, + visibility: ref visibility, + organizationId: ref organizationId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListModelsSecurityRequirements, + operationName: "VolumeServiceListModelsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("visibility", visibility?.ToValueString()) + .AddOptionalParameter("organizationId", organizationId) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + visibility: visibility, + organizationId: organizationId, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModels", + methodName: "VolumeServiceListModelsAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModels", + methodName: "VolumeServiceListModelsAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModels", + methodName: "VolumeServiceListModelsAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModels", + methodName: "VolumeServiceListModelsAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListModels", + methodName: "VolumeServiceListModelsAsync", + pathTemplate: "$\"/projects/{projectId}/models\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs new file mode 100644 index 00000000..85187be4 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs @@ -0,0 +1,507 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListOrganizationModelsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListOrganizationModelsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListOrganizationModelsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListOrganizationModelsSecurityRequirement0, + }; + partial void PrepareVolumeServiceListOrganizationModelsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string organizationId, + ref int? limit, + ref string? after); + partial void PrepareVolumeServiceListOrganizationModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string organizationId, + int? limit, + string? after); + partial void ProcessVolumeServiceListOrganizationModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListOrganizationModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List organization models
+ /// Lists custom models shared with every project in the specified organization. Project-private and public models are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListOrganizationModelsAsync( + string organizationId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListOrganizationModelsAsResponseAsync( + organizationId: organizationId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List organization models
+ /// Lists custom models shared with every project in the specified organization. Project-private and public models are not included. + ///
+ /// + /// Organization identifier. + /// + /// + /// Maximum number of results to return. + /// + /// + /// Cursor from a previous list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListOrganizationModelsAsResponseAsync( + string organizationId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListOrganizationModelsArguments( + httpClient: HttpClient, + organizationId: ref organizationId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListOrganizationModelsSecurityRequirements, + operationName: "VolumeServiceListOrganizationModelsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/organizations/{organizationId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListOrganizationModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListOrganizationModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListOrganizationModels", + methodName: "VolumeServiceListOrganizationModelsAsync", + pathTemplate: "$\"/organizations/{organizationId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListOrganizationModels", + methodName: "VolumeServiceListOrganizationModelsAsync", + pathTemplate: "$\"/organizations/{organizationId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListOrganizationModels", + methodName: "VolumeServiceListOrganizationModelsAsync", + pathTemplate: "$\"/organizations/{organizationId}/models\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListOrganizationModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListOrganizationModels", + methodName: "VolumeServiceListOrganizationModelsAsync", + pathTemplate: "$\"/organizations/{organizationId}/models\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListOrganizationModels", + methodName: "VolumeServiceListOrganizationModelsAsync", + pathTemplate: "$\"/organizations/{organizationId}/models\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListOrganizationModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs new file mode 100644 index 00000000..81c1c7d3 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListRemoteModelUploadEventsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListRemoteModelUploadEventsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListRemoteModelUploadEventsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListRemoteModelUploadEventsSecurityRequirement0, + }; + partial void PrepareVolumeServiceListRemoteModelUploadEventsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref int? limit, + ref string? after); + partial void PrepareVolumeServiceListRemoteModelUploadEventsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + int? limit, + string? after); + partial void ProcessVolumeServiceListRemoteModelUploadEventsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List remote model upload events
+ /// Lists progress and diagnostic events for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// + /// Maximum number of events to return. + /// + /// + /// Cursor from a previous remote upload event list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadEventsAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListRemoteModelUploadEventsAsResponseAsync( + projectId: projectId, + id: id, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List remote model upload events
+ /// Lists progress and diagnostic events for a remote model import job. + ///
+ /// + /// Project identifier. + /// + /// + /// Remote upload identifier. + /// + /// + /// Maximum number of events to return. + /// + /// + /// Cursor from a previous remote upload event list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadEventsAsResponseAsync( + string projectId, + string id, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListRemoteModelUploadEventsArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListRemoteModelUploadEventsSecurityRequirements, + operationName: "VolumeServiceListRemoteModelUploadEventsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/uploads/{id}/events", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListRemoteModelUploadEventsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListRemoteModelUploadEventsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploadEvents", + methodName: "VolumeServiceListRemoteModelUploadEventsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploadEvents", + methodName: "VolumeServiceListRemoteModelUploadEventsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploadEvents", + methodName: "VolumeServiceListRemoteModelUploadEventsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListRemoteModelUploadEventsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploadEvents", + methodName: "VolumeServiceListRemoteModelUploadEventsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploadEvents", + methodName: "VolumeServiceListRemoteModelUploadEventsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListRemoteUploadEventsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListRemoteUploadEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs new file mode 100644 index 00000000..d4a5c526 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs @@ -0,0 +1,507 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListRemoteModelUploadsServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceListRemoteModelUploadsSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceListRemoteModelUploadsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceListRemoteModelUploadsSecurityRequirement0, + }; + partial void PrepareVolumeServiceListRemoteModelUploadsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref int? limit, + ref string? after); + partial void PrepareVolumeServiceListRemoteModelUploadsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + int? limit, + string? after); + partial void ProcessVolumeServiceListRemoteModelUploadsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List remote model uploads
+ /// Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of uploads to return. + /// + /// + /// Cursor from a previous remote upload list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadsAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceListRemoteModelUploadsAsResponseAsync( + projectId: projectId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List remote model uploads
+ /// Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. + ///
+ /// + /// Project identifier. + /// + /// + /// Maximum number of uploads to return. + /// + /// + /// Cursor from a previous remote upload list response. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadsAsResponseAsync( + string projectId, + int? limit = default, + string? after = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceListRemoteModelUploadsArguments( + httpClient: HttpClient, + projectId: ref projectId, + limit: ref limit, + after: ref after); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceListRemoteModelUploadsSecurityRequirements, + operationName: "VolumeServiceListRemoteModelUploadsAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/uploads", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListRemoteModelUploadsServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("after", after) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceListRemoteModelUploadsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + limit: limit, + after: after); + + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploads", + methodName: "VolumeServiceListRemoteModelUploadsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploads", + methodName: "VolumeServiceListRemoteModelUploadsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploads", + methodName: "VolumeServiceListRemoteModelUploadsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + httpMethod: "GET", + 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::Together.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); + ProcessVolumeServiceListRemoteModelUploadsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploads", + methodName: "VolumeServiceListRemoteModelUploadsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + httpMethod: "GET", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceListRemoteModelUploads", + methodName: "VolumeServiceListRemoteModelUploadsAsync", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", + httpMethod: "GET", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceListRemoteModelUploadsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeListRemoteUploadsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeListRemoteUploadsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs new file mode 100644 index 00000000..209eb6fa --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs @@ -0,0 +1,577 @@ + +#nullable enable + +namespace Together +{ + public partial class VolumeServiceClient + { + + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceUpdateModelServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", + description: ""), + }; + + + private static readonly global::Together.EndPointSecurityRequirement s_VolumeServiceUpdateModelSecurityRequirement0 = + new global::Together.EndPointSecurityRequirement + { + Authorizations = new global::Together.EndPointAuthorizationRequirement[] + { new global::Together.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BearerAuth", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Together.EndPointSecurityRequirement[] s_VolumeServiceUpdateModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_VolumeServiceUpdateModelSecurityRequirement0, + }; + partial void PrepareVolumeServiceUpdateModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + ref string id, + ref string? updateMask, + global::Together.DeUpdateModelRequest request); + partial void PrepareVolumeServiceUpdateModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + string id, + string? updateMask, + global::Together.DeUpdateModelRequest request); + partial void ProcessVolumeServiceUpdateModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVolumeServiceUpdateModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( + string projectId, + string id, + + global::Together.DeUpdateModelRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VolumeServiceUpdateModelAsResponseAsync( + projectId: projectId, + id: id, + + request: request, + updateMask: updateMask, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VolumeServiceUpdateModelAsResponseAsync( + string projectId, + string id, + + global::Together.DeUpdateModelRequest request, + string? updateMask = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVolumeServiceUpdateModelArguments( + httpClient: HttpClient, + projectId: ref projectId, + id: ref id, + updateMask: ref updateMask, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VolumeServiceUpdateModelSecurityRequirements, + operationName: "VolumeServiceUpdateModelAsync"); + + using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Together.PathBuilder( + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceUpdateModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); + __pathBuilder + .AddOptionalParameter("updateMask", updateMask) + ; + var __path = __pathBuilder.ToString(); + __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVolumeServiceUpdateModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId!, + id: id!, + updateMask: updateMask, + 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::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceUpdateModel", + methodName: "VolumeServiceUpdateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceUpdateModel", + methodName: "VolumeServiceUpdateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceUpdateModel", + methodName: "VolumeServiceUpdateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "PATCH", + 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::Together.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); + ProcessVolumeServiceUpdateModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceUpdateModel", + methodName: "VolumeServiceUpdateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "PATCH", + 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::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VolumeServiceUpdateModel", + methodName: "VolumeServiceUpdateModelAsync", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", + httpMethod: "PATCH", + 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); + } + // Default error response + if (!__response.IsSuccessStatusCode) + { + string? __content_default = null; + global::System.Exception? __exception_default = null; + global::Together.ErrorData? __value_default = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + else + { + __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_default = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_default ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_default, + responseBody: __content_default, + responseObject: __value_default, + 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); + ProcessVolumeServiceUpdateModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DeModel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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::Together.DeModel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.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 global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a model
+ /// Updates mutable model metadata such as its inference name, description, base model, or visibility. + ///
+ /// + /// Project identifier. + /// + /// + /// Model identifier. + /// + /// + /// Fields to update. If omitted, all mutable fields are overwritten. + /// + /// + /// Updated inference-addressable model name. + /// + /// + /// Updated user-facing model description. + /// + /// + /// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
+ /// Default Value: VISIBILITY_PRIVATE + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( + string projectId, + string id, + string? updateMask = default, + string? name = default, + string? description = default, + global::Together.DeUpdateModelRequestVisibility? visibility = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.DeUpdateModelRequest + { + Name = name, + Description = description, + Visibility = visibility, + }; + + return await VolumeServiceUpdateModelAsync( + projectId: projectId, + id: id, + updateMask: updateMask, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs new file mode 100644 index 00000000..940f3d98 --- /dev/null +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +namespace Together +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class VolumeServiceClient : global::Together.IVolumeServiceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.together.ai/v2"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Together.AutoSDKClientOptions Options { get; } + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the VolumeServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public VolumeServiceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the VolumeServiceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public VolumeServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the VolumeServiceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public VolumeServiceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Together.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Together.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs index 7479d6d3..731e559a 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsStorageVolumesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_DeleteDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -110,7 +123,9 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -355,18 +370,17 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -393,18 +407,17 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -436,17 +449,15 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -481,17 +492,15 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs index 1103d0b9..ebcd98a4 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsStorageVolumesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_EditDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -123,7 +136,9 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -375,18 +390,17 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Volume not found if ((int)__response.StatusCode == 404) @@ -413,18 +427,17 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -451,18 +464,17 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -496,17 +508,15 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -543,17 +553,15 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs index 670eda03..27cc947e 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageVolumesByIdServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -122,7 +135,9 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( var __pathBuilder = new global::Together.PathBuilder( path: $"/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress); + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("version", version?.ToString()) ; @@ -371,18 +386,17 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( __exception_400 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Volume not found if ((int)__response.StatusCode == 404) @@ -409,18 +423,17 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( __exception_404 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -447,18 +460,17 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( __exception_500 = __ex; } - throw new global::Together.ApiException( + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -492,17 +504,15 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -539,17 +549,15 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( { } - throw new global::Together.ApiException( + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Together/Generated/Together.VolumesClient.g.cs b/src/libs/Together/Generated/Together.VolumesClient.g.cs index 9993ef84..f4d8e459 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.g.cs @@ -10,7 +10,7 @@ namespace Together public sealed partial class VolumesClient : global::Together.IVolumesClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// public const string DefaultBaseUrl = "https://api.together.ai/v1"; @@ -20,7 +20,7 @@ public sealed partial class VolumesClient : global::Together.IVolumesClient, glo public global::System.Net.Http.HttpClient HttpClient { get; } /// - public System.Uri? BaseUri => HttpClient.BaseAddress; + public System.Uri? BaseUri => ResolveDisplayedBaseUri(); /// public global::System.Collections.Generic.List Authorizations { get; } @@ -42,6 +42,34 @@ public sealed partial class VolumesClient : global::Together.IVolumesClient, glo public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default; + + private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] + { new global::Together.AutoSDKServer( + id: "https-api-together-ai-v1", + name: "Default environment for APIs", + url: "https://api.together.ai/v1", + description: "Default environment for APIs"), + new global::Together.AutoSDKServer( + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + }; + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers; + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer + { + get => ResolveSelectedServer(); + set => SelectServer(value); + } + /// /// Creates a new instance of the VolumesClient. /// If no httpClient is provided, a new one will be created. @@ -140,5 +168,117 @@ partial void ProcessResponseContent( global::System.Net.Http.HttpClient client, global::System.Net.Http.HttpResponseMessage response, ref string content); + + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId) + { + if (string.IsNullOrWhiteSpace(serverId)) + { + return false; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase)) + { + AutoSDKServerConfiguration.SelectedServer = server; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return true; + } + } + + return false; + } + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer() + { + AutoSDKServerConfiguration.SelectedServer = null; + } + + private global::Together.AutoSDKServer? ResolveSelectedServer() + { + var selectedServer = AutoSDKServerConfiguration.SelectedServer; + if (selectedServer is null) + { + return null; + } + + foreach (var server in s_availableServers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server; + } + } + + return null; + } + + private void SelectServer(global::Together.AutoSDKServer? server) + { + if (server is null) + { + AutoSDKServerConfiguration.SelectedServer = null; + return; + } + + foreach (var candidate in s_availableServers) + { + if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal)) + { + AutoSDKServerConfiguration.SelectedServer = candidate; + AutoSDKServerConfiguration.ExplicitBaseUri = null; + return; + } + } + + throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server)); + } + + private global::System.Uri? ResolveDisplayedBaseUri() + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress); + } + + private global::System.Uri? ResolveBaseUri( + global::Together.AutoSDKServer[] servers, + string defaultBaseUrl) + { + if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri) + { + return explicitBaseUri; + } + + if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer) + { + foreach (var server in servers) + { + if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal)) + { + return server.Uri; + } + } + } + + if (servers.Length > 0) + { + return servers[0].Uri; + } + + return string.IsNullOrWhiteSpace(defaultBaseUrl) + ? HttpClient.BaseAddress + : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute); + } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/autosdk.generated-examples.json b/src/libs/Together/Generated/autosdk.generated-examples.json index 373f93df..f09b156c 100644 --- a/src/libs/Together/Generated/autosdk.generated-examples.json +++ b/src/libs/Together/Generated/autosdk.generated-examples.json @@ -17,7 +17,7 @@ "Slug": "create-job", "Description": "Create a fine-tuning job with the provided model and training data.", "Language": "http", - "Code": "### Create job\nPOST {{host}}/fine-tunes\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022training_file\u0022: \u0022string\u0022,\n \u0022validation_file\u0022: \u0022string\u0022,\n \u0022packing\u0022: true,\n \u0022max_seq_length\u0022: 0,\n \u0022model\u0022: \u0022string\u0022,\n \u0022n_epochs\u0022: 1,\n \u0022n_checkpoints\u0022: 1,\n \u0022n_evals\u0022: 0,\n \u0022batch_size\u0022: \u0022max\u0022,\n \u0022gradient_accumulation_steps\u0022: 1,\n \u0022learning_rate\u0022: 0.00001,\n \u0022lr_scheduler\u0022: {\n \u0022lr_scheduler_type\u0022: \u0022linear\u0022,\n \u0022lr_scheduler_args\u0022: {\n \u0022min_lr_ratio\u0022: 0\n }\n },\n \u0022warmup_ratio\u0022: 0,\n \u0022max_grad_norm\u0022: 1,\n \u0022weight_decay\u0022: 0,\n \u0022random_seed\u0022: 0,\n \u0022suffix\u0022: \u0022string\u0022,\n \u0022wandb_api_key\u0022: \u0022string\u0022,\n \u0022wandb_base_url\u0022: \u0022string\u0022,\n \u0022wandb_project_name\u0022: \u0022string\u0022,\n \u0022wandb_name\u0022: \u0022string\u0022,\n \u0022wandb_entity\u0022: \u0022string\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022,\n \u0022training_method\u0022: {\n \u0022method\u0022: \u0022sft\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022\n },\n \u0022training_type\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022multimodal_params\u0022: {\n \u0022train_vision\u0022: true\n },\n \u0022from_checkpoint\u0022: \u0022string\u0022,\n \u0022from_hf_model\u0022: \u0022string\u0022,\n \u0022hf_model_revision\u0022: \u0022string\u0022,\n \u0022hf_api_token\u0022: \u0022string\u0022,\n \u0022hf_output_repo_name\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Fine-tuning job initiated successfully\n# Content-Type: application/json", + "Code": "### Create job\nPOST {{host}}/fine-tunes\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022training_file\u0022: \u0022string\u0022,\n \u0022validation_file\u0022: \u0022string\u0022,\n \u0022packing\u0022: true,\n \u0022max_seq_length\u0022: 0,\n \u0022model\u0022: \u0022string\u0022,\n \u0022n_epochs\u0022: 1,\n \u0022n_checkpoints\u0022: 1,\n \u0022n_evals\u0022: 0,\n \u0022batch_size\u0022: \u0022max\u0022,\n \u0022gradient_accumulation_steps\u0022: 0,\n \u0022learning_rate\u0022: 0.00001,\n \u0022lr_scheduler\u0022: {\n \u0022lr_scheduler_type\u0022: \u0022linear\u0022,\n \u0022lr_scheduler_args\u0022: {\n \u0022min_lr_ratio\u0022: 0.0\n }\n },\n \u0022warmup_ratio\u0022: 0.0,\n \u0022max_grad_norm\u0022: 1.0,\n \u0022weight_decay\u0022: 0.0,\n \u0022random_seed\u0022: 0,\n \u0022early_stopping_enabled\u0022: false,\n \u0022early_stopping_patience\u0022: 2,\n \u0022early_stopping_min_delta\u0022: 0.0,\n \u0022early_stopping_warmup_evals\u0022: 1,\n \u0022suffix\u0022: \u0022string\u0022,\n \u0022wandb_api_key\u0022: \u0022string\u0022,\n \u0022wandb_base_url\u0022: \u0022string\u0022,\n \u0022wandb_project_name\u0022: \u0022string\u0022,\n \u0022wandb_name\u0022: \u0022string\u0022,\n \u0022wandb_entity\u0022: \u0022string\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022,\n \u0022training_method\u0022: {\n \u0022method\u0022: \u0022sft\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022\n },\n \u0022training_type\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022multimodal_params\u0022: {\n \u0022train_vision\u0022: true\n },\n \u0022from_checkpoint\u0022: \u0022string\u0022,\n \u0022from_hf_model\u0022: \u0022string\u0022,\n \u0022hf_model_revision\u0022: \u0022string\u0022,\n \u0022hf_api_token\u0022: \u0022string\u0022,\n \u0022hf_output_repo_name\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Fine-tuning job initiated successfully\n# Content-Type: application/json", "Format": "http", "OperationId": "createFineTunes", "Setup": null diff --git a/src/libs/Together/openapi.yaml b/src/libs/Together/openapi.yaml index b5cee327..e7819295 100644 --- a/src/libs/Together/openapi.yaml +++ b/src/libs/Together/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.1.0 info: title: Together APIs description: The Together REST API. See https://docs.together.ai for more details. - version: 2.0.0 + version: '2.0.0' termsOfService: https://www.together.ai/terms-of-service contact: name: Together Support @@ -12,4824 +12,3877 @@ info: url: https://github.com/togethercomputer/openapi/blob/main/LICENSE servers: - url: https://api.together.ai/v1 + description: Default environment for APIs + - url: https://api-inference.together.ai/v2 + description: Optimized environment for inference security: - bearerAuth: [] paths: - /deployments: + /organizations/{organizationId}/endpoints: get: - description: Get a list of all deployments in your project - summary: Get the list of deployments - tags: - - Deployments + tags: [EndpointService] + summary: List organization endpoints + description: Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. + operationId: EndpointService_ListOrganizationEndpoints + servers: + - url: https://api.together.ai/v2 + parameters: + - name: organizationId + in: path + required: true + schema: + description: Organization identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of results to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous list response. + - name: orderBy + in: query + schema: + type: string + description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + - name: filter + in: query + schema: + type: string + description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint name. responses: - '200': - description: List of deployments + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/DeploymentListResponse' - '500': - description: Internal server error + $ref: '#/components/schemas/DE.ListEndpointsResponse' + default: + description: Default error response content: application/json: schema: - type: object - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployments = client.beta.jig.list() - print(deployments) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployments = await client.beta.jig.list(); - console.log(deployments); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployments = await client.beta.jig.list(); - console.log(deployments); - - lang: Shell - label: cURL - source: | - curl -X GET \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments - post: - description: Create a new deployment with specified configuration - summary: Create a new deployment - tags: - - Deployments - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployment = client.beta.jig.deploy( - name="my-deployment", - gpu_type="h100-80gb", - image="registry.together.ai/proj_abcdefg1234567890/my-image:latest" - ) - print(deployment) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.deploy({ - name: "my-deployment", - gpu_type: "h100-80gb", - image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" - }); - console.log(deployment); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.deploy({ - name: "my-deployment", - gpu_type: "h100-80gb", - image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" - }); - console.log(deployment); - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDeploymentRequest' - description: Deployment configuration - required: true + $ref: '#/components/schemas/ErrorData' + /organizations/{organizationId}/models: + get: + tags: [VolumeService] + summary: List organization models + description: Lists custom models shared with every project in the specified organization. Project-private and public models are not included. + operationId: VolumeService_ListOrganizationModels + servers: + - url: https://api.together.ai/v2 + parameters: + - name: organizationId + in: path + required: true + schema: + description: Organization identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of results to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous list response. responses: - '200': - description: Deployment created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentResponseItem' - '400': - description: Invalid request + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.ListModelsResponse' + default: + description: Default error response content: application/json: schema: - type: object - /deployments/{id}: - delete: - description: Delete an existing deployment - summary: Delete a deployment - tags: - - Deployments + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/configs: + get: + tags: [ConfigService] + summary: List model configurations + description: Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project. + operationId: ConfigService_ListProjectConfigs + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: Deployment ID or name + description: Project identifier. type: string - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployment = client.beta.jig.destroy("my-deployment") - print(deployment) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.destroy("my-deployment"); - console.log(deployment); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.destroy("my-deployment"); - console.log(deployment); - - lang: Shell - label: cURL - source: | - curl -X DELETE \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments/my-deployment + - name: referenceModelId + in: query + schema: + type: string + description: Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree. + - name: referenceModel + in: query + schema: + type: string + description: Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree. + - name: limit + in: query + schema: + type: integer + description: Maximum number of results to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous list response. responses: - '200': - description: Deployment deleted successfully - content: - application/json: - schema: - type: object - '404': - description: Deployment not found + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.ListProjectConfigsResponse' + default: + description: Default error response content: application/json: schema: - type: object + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/configs/{id}: get: - description: Retrieve details of a specific deployment by its ID or name - summary: Get a deployment by ID or name - tags: - - Deployments + tags: [ConfigService] + summary: Get a model configuration + description: Retrieves a model configuration revision by ID, including its runtime selectors and certifications. + operationId: ConfigService_GetProjectConfig + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: Deployment ID or name + description: Config revision identifier. type: string - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployment = client.beta.jig.retrieve("my-deployment") - print(deployment) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.retrieve("my-deployment"); - console.log(deployment); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.retrieve("my-deployment"); - console.log(deployment); responses: - '200': - description: Deployment details + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/DeploymentResponseItem' - '404': - description: Deployment not found + $ref: '#/components/schemas/DE.ModelConfig' + default: + description: Default error response content: application/json: schema: - type: object - '500': - description: Internal server error - content: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints: + get: + tags: [EndpointService] + summary: List endpoints + description: Lists the dedicated inference endpoints owned by the specified project. + operationId: EndpointService_ListEndpoints + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: limit + in: query + schema: + type: integer + default: 50 + description: Maximum number of endpoints to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous response. + - name: orderBy + in: query + schema: + type: string + description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + - name: filter + in: query + schema: + type: string + description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `/`. + responses: + "200": + description: OK + content: application/json: schema: - type: object + $ref: '#/components/schemas/DE.ListEndpointsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + post: + tags: [EndpointService] + summary: Create an endpoint + description: Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. + operationId: EndpointService_CreateEndpoint + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CreateEndpointRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.Endpoint' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{id}: patch: - description: Update an existing deployment configuration - summary: Update a deployment - tags: - - Deployments - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployment = client.beta.jig.update("my-deployment", gpu_count=2) - print(deployment) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const deployment = await client.beta.jig.update("my-deployment", { - gpu_count: 2 }); - - console.log(deployment); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const deployment = await client.beta.jig.update("my-deployment", { - gpu_count: 2 }); - - console.log(deployment); - - lang: Shell - label: cURL - source: | - curl -X PATCH \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - --data '{ "gpu_count": 2 }' \ - https://api.together.ai/v1/deployments/my-deployment + tags: [EndpointService] + summary: Update an endpoint + description: Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. + operationId: EndpointService_UpdateEndpoint + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: Deployment ID or name + description: Endpoint identifier. + type: string + - name: updateMask + in: query + schema: type: string + description: Fields to update. If not set, the fields populated are updated. requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdateDeploymentRequest' - description: Updated deployment configuration + $ref: '#/components/schemas/DE.EndpointUpdate' required: true responses: - '200': - description: Deployment updated successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/DeploymentResponseItem' - '400': - description: Invalid request + $ref: '#/components/schemas/DE.Endpoint' + default: + description: Default error response content: application/json: schema: - type: object - '404': - description: Deployment not found + $ref: '#/components/schemas/ErrorData' + get: + tags: [EndpointService] + summary: Get an endpoint + description: Retrieves an endpoint and lightweight summaries of the deployments attached to it. + operationId: EndpointService_GetEndpoint + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: id + in: path + required: true + schema: + description: Endpoint identifier. + type: string + responses: + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.Endpoint' + default: + description: Default error response content: application/json: schema: - type: object - /deployments/{id}/logs: - get: - description: Retrieve logs from a deployment, optionally filtered by replica ID. - summary: Get logs for a deployment - tags: - - Deployments - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - deployment = client.beta.jig.logs("my-deployment") - print(deployment) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.logs("my-deployment"); - console.log(deployment); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const deployment = await client.beta.jig.logs("my-deployment"); - console.log(deployment); - - lang: Shell - label: cURL - source: | - curl -X GET \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments/my-deployment/logs + $ref: '#/components/schemas/ErrorData' + delete: + tags: [EndpointService] + summary: Delete an endpoint + description: Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. + operationId: EndpointService_DeleteEndpoint + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: Deployment ID or name + description: Endpoint identifier. type: string - - name: replica_id + - name: etag in: query - required: false schema: - description: Replica ID to filter logs type: string - - name: version + description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/deployments: + get: + tags: [DeploymentService] + summary: List deployments + description: Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. + operationId: DeploymentService_ListDeployments + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: ID of the project that owns the endpoint. + type: string + - name: endpointId + in: path + required: true + schema: + description: ID of the endpoint whose deployments are listed. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of deployments to return. Max 500, defaults to 50. + - name: after in: query schema: - description: >- - Deployment image version (tag or last 4 characters of image - digest) to filter logs type: string - - name: revision + description: Cursor from a previous deployment list response. + - name: orderBy in: query schema: - description: Deployment revision (UUID) to filter logs type: string + description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + - name: filter + in: query + schema: + type: string + description: Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `//`. responses: - '200': - description: Deployment logs + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/DeploymentLogs' - '404': - description: Deployment not found + $ref: '#/components/schemas/DE.ListDeploymentsResponse' + default: + description: Default error response content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/ErrorData' + post: + tags: [DeploymentService] + summary: Create a deployment + description: Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. + operationId: DeploymentService_CreateDeployment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: ID of the project that owns the endpoint. + type: string + - name: endpointId + in: path + required: true + schema: + description: ID of the endpoint that will contain the deployment. + type: string + - name: validateOnly + in: query + schema: + type: boolean + description: When true, validates the request without creating or provisioning a deployment. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CreateDeploymentRequest' + required: true + responses: + "200": + description: OK content: application/json: schema: - type: object - /deployments/secrets: - get: - description: Retrieve all secrets in your project - summary: Get the list of project secrets - tags: - - Secrets - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - secrets = client.beta.jig.secrets.list() - print(secrets) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const secrets = await client.beta.jig.secrets.list(); - console.log(secrets); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const secrets = await client.beta.jig.secrets.list(); - console.log(secrets); - responses: - '200': - description: List of secrets - content: - application/json: - schema: - $ref: '#/components/schemas/ListSecretsResponse' - '500': - description: Internal server error + $ref: '#/components/schemas/DE.Deployment' + default: + description: Default error response content: application/json: schema: - type: object - post: - description: Create a new secret to store sensitive configuration values - summary: Create a new secret - tags: - - Secrets - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - client.beta.jig.secrets.create(name="my-secret", value="my-value") - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - await client.beta.jig.secrets.create({ name: "my-secret", value: - "my-value" }); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - await client.beta.jig.secrets.create({ name: "my-secret", value: - "my-value" }); - - lang: Shell - label: cURL - source: | - curl -X POST \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - --data '{ "name": "my-secret", "value": "my-value" }' \ - https://api.together.ai/v1/deployments/secrets + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/deployments/{id}: + patch: + tags: [DeploymentService] + summary: Update a deployment + description: Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. + operationId: DeploymentService_UpdateDeployment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Deployment identifier. + type: string + - name: updateMask + in: query + schema: + type: string + description: Fields to update. If not set, the fields populated on `deployment` are updated. requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateSecretRequest' - description: Secret configuration + $ref: '#/components/schemas/DE.UpdateDeploymentRequest' required: true responses: - '200': - description: Secret created successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/SecretResponseItem' - '400': - description: Invalid request + $ref: '#/components/schemas/DE.Deployment' + default: + description: Default error response content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/ErrorData' + get: + tags: [DeploymentService] + summary: Get a deployment + description: Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. + operationId: DeploymentService_GetDeployment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Deployment identifier. + type: string + responses: + "200": + description: OK content: application/json: schema: - type: object - /deployments/secrets/{id}: + $ref: '#/components/schemas/DE.Deployment' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' delete: - description: Delete an existing secret - summary: Delete a secret - tags: - - Secrets - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - client.beta.jig.secrets.delete("my-secret") - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - await client.beta.jig.secrets.delete("my-secret"); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - await client.beta.jig.secrets.delete("my-secret"); - - lang: Shell - label: cURL - source: | - curl -X DELETE \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments/secrets/my-secret + tags: [DeploymentService] + summary: Delete a deployment + description: Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read. + operationId: DeploymentService_DeleteDeployment + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string - name: id in: path required: true schema: - description: Secret ID or name + description: Deployment identifier. + type: string + - name: etag + in: query + schema: type: string + description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. responses: - '200': - description: Secret deleted successfully - content: - application/json: - schema: - type: object - '404': - description: Secret not found + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response content: application/json: schema: - type: object + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters: get: - description: Retrieve details of a specific secret by its ID or name - summary: Get a secret by ID or name - tags: - - Secrets - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - secret = client.beta.jig.secrets.retrieve("my-secret") - print(secret) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const secret = await client.beta.jig.secrets.retrieve("my-secret"); - console.log(secret); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const secret = await client.beta.jig.secrets.retrieve("my-secret"); - console.log(secret); - - lang: Shell - label: cURL - source: | - curl -X GET \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments/secrets/my-secret + tags: [DeploymentService] + summary: List deployment adapters + description: Lists LoRA adapters attached to a deployment with per-cluster load state. + operationId: DeploymentService_ListAdapters + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: Secret ID or name + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: deploymentId + in: path + required: true + schema: + description: Deployment identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of adapters to return. + - name: after + in: query + schema: type: string + description: Cursor from a previous adapter list response. responses: - '200': - description: Secret details - content: - application/json: - schema: - $ref: '#/components/schemas/SecretResponseItem' - '404': - description: Secret not found + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.ListAdaptersResponse' + default: + description: Default error response content: application/json: schema: - type: object - patch: - description: Update an existing secret's value or metadata - summary: Update a secret - tags: - - Secrets - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - client.beta.jig.secrets.update("my-secret", value="my-new-value") - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - await client.beta.jig.secrets.update("my-secret", { value: - "my-new-value" }); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - await client.beta.jig.secrets.update("my-secret", { value: - "my-new-value" }); - - lang: Shell - label: cURL - source: | - curl -X PATCH \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - --data '{ "value": "my-new-value" }' \ - https://api.together.ai/v1/deployments/secrets/my-secret + $ref: '#/components/schemas/ErrorData' + post: + tags: [DeploymentService] + summary: Add a deployment adapter + description: Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. + operationId: DeploymentService_AddAdapter + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: Secret ID or name + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: deploymentId + in: path + required: true + schema: + description: Deployment identifier. type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdateSecretRequest' - description: Updated secret configuration + $ref: '#/components/schemas/DE.AddAdapterRequest' required: true responses: - '200': - description: Secret updated successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/SecretResponseItem' - '400': - description: Invalid request + $ref: '#/components/schemas/DE.AdapterEntry' + default: + description: Default error response content: application/json: schema: - type: object - '404': - description: Secret not found + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}: + get: + tags: [DeploymentService] + summary: Get a deployment adapter + description: Gets an attached adapter and its per-cluster load state. + operationId: DeploymentService_GetAdapter + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: deploymentId + in: path + required: true + schema: + description: Deployment identifier. + type: string + - name: id + in: path + required: true + schema: + description: Adapter model identifier. + type: string + responses: + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.AdapterEntry' + default: + description: Default error response content: application/json: schema: - type: object - /deployments/storage/{filename}: - get: - description: Download a file by redirecting to a signed URL - summary: Download a file - tags: - - DeploymentsStorage + $ref: '#/components/schemas/ErrorData' + delete: + tags: [DeploymentService] + summary: Remove a deployment adapter + description: Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. + operationId: DeploymentService_RemoveAdapter + servers: + - url: https://api.together.ai/v2 parameters: - - name: filename + - name: projectId in: path required: true schema: - description: Filename + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: deploymentId + in: path + required: true + schema: + description: Deployment identifier. + type: string + - name: id + in: path + required: true + schema: + description: Adapter model identifier. + type: string + - name: etag + in: query + required: true + schema: type: string + description: Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response. responses: - '307': - description: Redirect to signed download URL + "200": + description: OK content: application/json: schema: - type: string - '400': - description: Invalid request + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response content: application/json: schema: - additionalProperties: - type: string - type: object - '404': - description: File not found + $ref: '#/components/schemas/ErrorData' + patch: + tags: [DeploymentService] + summary: Update a deployment adapter + description: Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. + operationId: DeploymentService_UpdateAdapter + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: deploymentId + in: path + required: true + schema: + description: Deployment identifier. + type: string + - name: id + in: path + required: true + schema: + description: Adapter model identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.UpdateAdapterRequest' + required: true + responses: + "200": + description: OK content: application/json: schema: - additionalProperties: - type: string - type: object - '500': - description: Internal error + $ref: '#/components/schemas/DE.AdapterEntry' + default: + description: Default error response content: application/json: schema: - additionalProperties: - type: string - type: object - /deployments/storage/{filename}/url: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts: get: - description: Create a signed URL for downloading a deployment storage file - summary: Get a file download URL - tags: - - DeploymentsStorage + tags: [RolloutService] + summary: List endpoint rollouts + description: Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. + operationId: RolloutService_ListRollouts + servers: + - url: https://api.together.ai/v2 parameters: - - name: filename + - name: projectId in: path required: true schema: - description: Filename + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of rollouts to return. Max 500, defaults to 50. + - name: after + in: query + schema: + type: string + description: Cursor from a previous rollout list response. + - name: filter + in: query + schema: + enum: + - ROLLOUT_FILTER_ACTIVE + - ROLLOUT_FILTER_TERMINAL type: string + description: Narrow results to active or terminal rollouts. Omit to list all rollouts. responses: - '200': - description: Signed URL + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/SignedURLResponse' - '400': - description: Invalid request + $ref: '#/components/schemas/DE.ListRolloutsResponse' + default: + description: Default error response content: application/json: schema: - additionalProperties: - type: string - type: object - '404': - description: File not found + $ref: '#/components/schemas/ErrorData' + post: + tags: [RolloutService] + summary: Create a rollout + description: Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. + operationId: RolloutService_CreateRollout + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CreateRolloutRequest' + required: true + responses: + "200": + description: OK content: application/json: schema: - additionalProperties: - type: string - type: object - '500': - description: Internal error + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - additionalProperties: - type: string - type: object - /deployments/storage/volumes: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}: get: - description: Retrieve all volumes in your project - summary: Get the list of project volumes - tags: - - DeploymentsVolumes - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - volumes = client.beta.jig.storage.volumes.list() - print(volumes) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const volumes = await client.beta.jig.storage.volumes.list(); - console.log(volumes); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const volumes = await client.beta.jig.storage.volumes.list(); - console.log(volumes); - - lang: Shell - label: cURL - source: | - curl -X GET \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - https://api.together.ai/v1/deployments/storage/volumes - responses: - '200': - description: List of volumes - content: - application/json: - schema: - $ref: '#/components/schemas/ListVolumesResponse' - '500': - description: Internal server error - content: - application/json: - schema: - type: object - post: - description: Create a new volume to preload files in deployments - summary: Create a new volume - tags: - - DeploymentsVolumes - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - volumes = client.beta.jig.volumes.create(name="my-volume") - print(volumes) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const volumes = await client.beta.jig.volumes.create({ name: - "my-volume" }); - - console.log(volumes); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const volumes = await client.beta.jig.volumes.create({ name: - "my-volume" }); - - console.log(volumes); - - lang: Shell - label: cURL - source: | - curl -X POST \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - --data '{ "name": "my-volume" }' \ - https://api.together.ai/v1/deployments/storage/volumes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVolumeRequest' - description: Volume configuration - required: true + tags: [RolloutService] + summary: Get a rollout + description: Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. + operationId: RolloutService_GetRollout + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Rollout identifier. + type: string responses: - '200': - description: Volume created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/VolumeResponseItem' - '400': - description: Invalid request + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - type: object - /deployments/storage/volumes/{id}: + $ref: '#/components/schemas/ErrorData' delete: - description: Delete an existing volume + tags: [RolloutService] + summary: Delete a rollout + description: Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. + operationId: RolloutService_DeleteRollout + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string - name: id in: path required: true schema: - description: Volume ID or name + description: Rollout identifier. type: string + - name: etag + in: query + schema: + type: string + description: Etag for optimistic concurrency. responses: - '200': - description: Volume deleted successfully - content: - application/json: - schema: - type: object - '404': - description: Volume not found + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response content: application/json: schema: - type: object - summary: Delete a volume - tags: - - Volumes - get: - description: Retrieve details of a specific volume by its ID or name + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start: + post: + tags: [RolloutService] + summary: Start a rollout + description: Starts a pending rollout and begins its configured traffic-shifting workflow. + operationId: RolloutService_StartRollout + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: Volume ID or name + description: Project identifier. type: string - - name: version - in: query + - name: endpointId + in: path + required: true schema: - description: Volume version to describe (defaults to current version) - type: integer + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Rollout identifier. + type: string responses: - '200': - description: Volume details + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/VolumeResponseItem' - '400': - description: Bad request + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - type: object - '404': - description: Volume not found + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause: + post: + tags: [RolloutService] + summary: Pause a rollout + description: Pauses a running rollout at its current traffic split and records an optional reason. + operationId: RolloutService_PauseRollout + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Rollout identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.PauseRolloutRequest' + required: true + responses: + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - type: object - summary: Get a volume by ID or name - tags: - - Volumes - patch: - description: Update an existing volume's configuration or contents + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume: + post: + tags: [RolloutService] + summary: Resume a rollout + description: Resumes a paused rollout from its current step and traffic split. + operationId: RolloutService_ResumeRollout + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string - name: id in: path required: true schema: - description: Volume ID or name. + description: Rollout identifier. type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdateVolumeRequest' - description: Updated volume configuration + $ref: '#/components/schemas/DE.ResumeRolloutRequest' required: true responses: - '200': - description: Volume updated successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/VolumeResponseItem' - '400': - description: Invalid request + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - type: object - '404': - description: Volume not found + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel: + post: + tags: [RolloutService] + summary: Cancel a rollout + description: Cancels a running, paused, system-paused, or stabilizing rollout by freezing the current traffic split, or by reverting all traffic to the source deployment when requested. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED for freeze or ABORTED for revert. + operationId: RolloutService_CancelRollout + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Rollout identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CancelRolloutRequest' + required: true + responses: + "200": + description: OK content: application/json: schema: - type: object - '500': - description: Internal server error + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response content: application/json: schema: - type: object - summary: Update a volume - tags: - - Volumes - /voices: - get: - tags: - - Voices - summary: Fetch available voices for each model - description: Fetch available voices for each model - operationId: fetchVoices + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote: + post: + tags: [RolloutService] + summary: Promote a rollout + description: Completes a running or paused rollout immediately by sending all live traffic to the target deployment. + operationId: RolloutService_PromoteRollout + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Rollout identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.PromoteRolloutRequest' + required: true responses: - '200': - description: Success + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ListVoicesResponse' - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.audio.voices.list() - - print(response.data) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.audio.voices.list() - - print(response.data) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.audio.voices.list() - - console.log(response.data); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.audio.voices.list() - - console.log(response.data); - /videos/{id}: + $ref: '#/components/schemas/DE.Rollout' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/abExperiments: get: - tags: - - Video - summary: Fetch video metadata - description: Fetch video metadata + tags: [ABExperimentService] + summary: List A/B experiments + description: Lists the managed live-traffic experiments configured for an endpoint. + operationId: ABExperimentService_ListABExperiments servers: - url: https://api.together.ai/v2 - operationId: retrieveVideo - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.videos.retrieve(video_id) - - print(response.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.videos.retrieve(video_id) - - print(response.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.videos.retrieve(videoId); - - console.log(response.status); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.videos.retrieve(videoId); - - console.log(response.status); parameters: - - in: path - name: id + - name: projectId + in: path required: true schema: - description: Identifier of video from create response. + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of A/B experiments to return. Max 500, defaults to 50. + - name: after + in: query + schema: type: string + description: Cursor from a previous A/B experiment list response. responses: - '200': - description: Success + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/VideoJob' - '400': - description: Invalid request parameters. - '404': - description: Video ID not found. - /videos: + $ref: '#/components/schemas/DE.ListABExperimentsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' post: - tags: - - Video - summary: Create video - description: Create a video - operationId: createVideo + tags: [ABExperimentService] + summary: Create an A/B experiment + description: Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control. + operationId: ABExperimentService_CreateABExperiment servers: - url: https://api.together.ai/v2 - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.videos.create( - model="together/video-model", - prompt="A cartoon of an astronaut riding a horse on the moon" - ) - - print(response.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.videos.create( - model="together/video-model", - prompt="A cartoon of an astronaut riding a horse on the moon" - ) - - print(response.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.videos.create({ - model: "together/video-model", - prompt: "A cartoon of an astronaut riding a horse on the moon", - }); - - console.log(response.id); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.videos.create({ - model: "together/video-model", - prompt: "A cartoon of an astronaut riding a horse on the moon", - }); - - console.log(response.id); - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVideoBody' + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CreateABExperimentRequest' + required: true responses: - '200': - description: Success + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/VideoJob' - /chat/completions: - post: - tags: - - Chat - summary: Create chat completion - description: >- - Generate a model response for a given chat conversation. Supports single - queries and multi-turn conversations with system, user, and assistant - messages. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.chat.completions.create( - model="Qwen/Qwen3.5-9B", - messages=[ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "What are some fun things to do in New York?"}, - ], - reasoning={"enabled": False} - ) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.chat.completions.create( - model="Qwen/Qwen3.5-9B", - messages=[ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "What are some fun things to do in New York?"}, - ], - reasoning={"enabled": False} - ) - - print(response.choices[0].message.content) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.chat.completions.create({ - model: "Qwen/Qwen3.5-9B", - messages: [ - { role: "system", content: "You are a helpful assistant." }, - { role: "user", "content": "What are some fun things to do in New York?" }, - ], - reasoning: { enabled: false }, - }); - - console.log(response.choices[0].message?.content); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.chat.completions.create({ - model: "Qwen/Qwen3.5-9B", - messages: [ - { role: "system", content: "You are a helpful assistant." }, - { role: "user", "content": "What are some fun things to do in New York?" }, - ], - reasoning: { enabled: false }, - }); - - console.log(response.choices[0].message?.content); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/chat/completions" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "Qwen/Qwen3.5-9B", - "messages": [ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "What are some fun things to do in New York?"} - ], - "reasoning": {"enabled": false} - }' - operationId: chat-completions + $ref: '#/components/schemas/DE.ABExperiment' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}: + patch: + tags: [ABExperimentService] + summary: Update an A/B experiment + description: Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. + operationId: ABExperimentService_UpdateABExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: A/B experiment identifier. + type: string + - name: updateMask + in: query + schema: + type: string + description: Fields to update. If omitted, all mutable fields are overwritten. requestBody: content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionRequest' + $ref: '#/components/schemas/DE.UpdateABExperimentRequest' + required: true responses: - '200': - description: '200' + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionResponse' - text/event-stream: - schema: - $ref: '#/components/schemas/ChatCompletionStream' - '400': - description: BadRequest + $ref: '#/components/schemas/DE.ABExperiment' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + get: + tags: [ABExperimentService] + summary: Get an A/B experiment + description: Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + operationId: ABExperimentService_GetABExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: A/B experiment identifier. + type: string + responses: + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: NotFound + $ref: '#/components/schemas/DE.ABExperiment' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + delete: + tags: [ABExperimentService] + summary: Delete an A/B experiment + description: Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. + operationId: ABExperimentService_DeleteABExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: A/B experiment identifier. + type: string + - name: etag + in: query + schema: + type: string + description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '503': - description: Overloaded + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments: + get: + tags: [ShadowExperimentService] + summary: List shadow experiments + description: Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. + operationId: ShadowExperimentService_ListShadowExperiments + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of shadow experiments to return. Max 500, defaults to 50. + - name: after + in: query + schema: + type: string + description: Cursor from a previous shadow experiment list response. + - name: includeTargets + in: query + schema: + type: boolean + description: Whether to include target deployments in each returned shadow experiment. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.ListShadowExperimentsResponse' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '504': - description: Timeout + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - deprecated: false - /completions: post: - tags: - - Completion - summary: Create completion - description: >- - Generate text completions for a given prompt using a language, code, or - image model. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.completions.create( - model="Qwen/Qwen3.5-9B", - prompt="The largest city in France is", - max_tokens=1 - ) - - print(response.choices[0].text) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.completions.create( - model="Qwen/Qwen3.5-9B", - prompt="The largest city in France is", - max_tokens=1 - ) - - print(response.choices[0].text) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.completions.create({ - model: "Qwen/Qwen3.5-9B", - prompt: "The largest city in France is", - max_tokens: 1, - }); - - console.log(response.choices[0].text); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.completions.create({ - model: "Qwen/Qwen3.5-9B", - prompt: "The largest city in France is", - max_tokens: 1 - }); - - console.log(response.choices[0].text); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/completions" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "Qwen/Qwen3.5-9B", - "prompt": "The largest city in France is", - "max_tokens": 1 - }' - operationId: completions + tags: [ShadowExperimentService] + summary: Create a shadow experiment + description: Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. + operationId: ShadowExperimentService_CreateShadowExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/CompletionRequest' + $ref: '#/components/schemas/DE.CreateShadowExperimentRequest' + required: true responses: - '200': - description: '200' - content: - application/json: - schema: - $ref: '#/components/schemas/CompletionResponse' - text/event-stream: - schema: - $ref: '#/components/schemas/CompletionStream' - '400': - description: BadRequest - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: NotFound - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '503': - description: Overloaded + $ref: '#/components/schemas/DE.ShadowExperiment' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '504': - description: Timeout + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - deprecated: false - /embeddings: - post: - tags: - - Embeddings - summary: Create embedding - description: >- - Generate vector embeddings for one or more text inputs. Returns - numerical arrays representing semantic meaning, useful for search, - classification, and retrieval. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.embeddings.create( - model="BAAI/bge-large-en-v1.5", - input="New York City", - ) - - print(response.data[0].embedding) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.embeddings.create( - model="BAAI/bge-large-en-v1.5", - input="New York City", - ) - - print(response.data[0].embedding) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.embeddings.create({ - model: "BAAI/bge-large-en-v1.5", - input: "New York City", - }); - - console.log(response.data[0].embedding); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.embeddings.create({ - model: "BAAI/bge-large-en-v1.5", - input: "New York City", - }); - - console.log(response.data[0].embedding); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/embeddings" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "BAAI/bge-large-en-v1.5", - "input": "New York City" - }' - operationId: embeddings + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}: + patch: + tags: [ShadowExperimentService] + summary: Update a shadow experiment + description: Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. + operationId: ShadowExperimentService_UpdateShadowExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + - name: updateMask + in: query + required: true + schema: + type: string + description: Required fields to update, such as description or source. requestBody: content: application/json: schema: - $ref: '#/components/schemas/EmbeddingsRequest' + $ref: '#/components/schemas/DE.UpdateShadowExperimentRequest' + required: true responses: - '200': - description: '200' + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/EmbeddingsResponse' - '400': - description: BadRequest + $ref: '#/components/schemas/DE.ShadowExperiment' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '404': - description: NotFound + get: + tags: [ShadowExperimentService] + summary: Get a shadow experiment + description: Retrieves a shadow experiment, including its sampling strategy and target deployments. + operationId: ShadowExperimentService_GetShadowExperiment + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + responses: + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + $ref: '#/components/schemas/DE.ShadowExperiment' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '503': - description: Overloaded + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '504': - description: Timeout - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - deprecated: false - /models: - get: - tags: - - Models - summary: List all models - description: >- - Lists all of Together's open-source models and metadata including - pricing, chat template, and context. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - models = client.models.list() - - for model in models: - print(model.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - models = client.models.list() - - for model in models: - print(model.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const models = await client.models.list(); - - for (const model of models) { - console.log(model.id); - } - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const models = await client.models.list(); - - for (const model of models) { - console.log(model.id); - } - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/models" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - operationId: models + delete: + tags: [ShadowExperimentService] + summary: Delete a shadow experiment + description: Deletes a shadow experiment and its target records. The underlying deployments are not deleted. + operationId: ShadowExperimentService_DeleteShadowExperiment + servers: + - url: https://api.together.ai/v2 parameters: - - name: dedicated + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: id + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + - name: etag in: query schema: - description: Filter models to only return dedicated models - type: boolean + type: string + description: Etag for optimistic concurrency. responses: - '200': - description: '200' + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ModelInfoList' - '400': - description: BadRequest + $ref: '#/components/schemas/DE.DeleteResponse' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '404': - description: NotFound + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets: + get: + tags: [ShadowExperimentService] + summary: List shadow experiment targets + description: Lists the deployments that receive mirrored requests from a shadow experiment. + operationId: ShadowExperimentService_ListTargets + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: experimentId + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of targets to return. Max 500, defaults to 50. + - name: after + in: query + schema: + type: string + description: Cursor from a previous shadow experiment target list response. + responses: + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + $ref: '#/components/schemas/DE.ListShadowExperimentTargetsResponse' + "400": + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '504': - description: Timeout + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - deprecated: false post: - tags: - - Models - summary: Upload a custom model or adapter - description: Upload a custom model or adapter from Hugging Face or S3 - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.models.upload( - model_name="My-Fine-Tuned-Model", - model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", - ) - - print(response.data.job_id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.models.upload( - "My-Fine-Tuned-Model", - "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", - ) - - print(response.job_id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.models.upload({ - model_name: "My-Fine-Tuned-Model", - model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", - }) - - console.log(response); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.models.upload({ - model_name: "My-Fine-Tuned-Model", - model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", - }) - - console.log(response); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/models" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model_name": "My-Fine-Tuned-Model", - "model_source": "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz" - }' - operationId: uploadModel + tags: [ShadowExperimentService] + summary: Create a shadow experiment target + description: Adds a deployment under the same endpoint as a target for mirrored requests. + operationId: ShadowExperimentService_CreateTarget + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: experimentId + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/ModelUploadRequest' + $ref: '#/components/schemas/DE.CreateShadowExperimentTargetRequest' + required: true responses: - '200': - description: Model / adapter upload job created successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ModelUploadSuccessResponse' - /jobs/{jobId}: - get: - tags: - - Jobs - summary: Get job status - description: Get the status of a specific job - operationId: getJob - parameters: - - name: jobId - in: path - required: true - schema: - example: job-a15dad11-8d8e-4007-97c5-a211304de284 - description: The ID of the job to retrieve - type: string - responses: - '200': - description: Job status retrieved successfully + $ref: '#/components/schemas/DE.ShadowExperimentTarget' + "400": + description: Invalid request content: application/json: schema: - $ref: '#/components/schemas/JobInfoSuccessResponse' - /jobs: - get: - tags: - - Jobs - summary: List all jobs - description: List all jobs and their statuses - operationId: listJobs - responses: - '200': - description: Jobs retrieved successfully + $ref: '#/components/schemas/ErrorData' + default: + description: Default error response content: application/json: schema: - $ref: '#/components/schemas/JobsInfoSuccessResponse' - /images/generations: - post: - tags: - - Images - summary: Create image - description: Use an image model to generate an image for a given prompt. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.images.generate( - model="black-forest-labs/FLUX.1-schnell", - steps=4, - prompt="A cartoon of an astronaut riding a horse on the moon", - ) - - print(response.data[0].url) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.images.generate( - model="black-forest-labs/FLUX.1-schnell", - steps=4, - prompt="A cartoon of an astronaut riding a horse on the moon", - ) - - print(response.data[0].url) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.images.generate({ - model: "black-forest-labs/FLUX.1-schnell", - prompt: "A cartoon of an astronaut riding a horse on the moon", - }); - - console.log(response.data[0].url); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.images.generate({ - model: "black-forest-labs/FLUX.1-schnell", - prompt: "A cartoon of an astronaut riding a horse on the moon", - }); - - console.log(response.data[0].url); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/images/generations" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "black-forest-labs/FLUX.1-schnell", - "prompt": "A cartoon of an astronaut riding a horse on the moon" - }' + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}: + patch: + tags: [ShadowExperimentService] + summary: Update a shadow experiment target + description: Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. + operationId: ShadowExperimentService_UpdateTarget + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: experimentId + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + - name: id + in: path + required: true + schema: + description: Shadow experiment target identifier. + type: string + - name: updateMask + in: query + required: true + schema: + type: string + description: Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `description`. requestBody: - required: true content: application/json: schema: - type: object - required: - - prompt - - model - properties: - prompt: - type: string - description: >- - A description of the desired images. Maximum length varies - by model. - example: cat floating in space, cinematic - model: - type: string - description: > - The model to use for image generation.

[See all of - Together AI's image - models](https://docs.together.ai/docs/serverless-models#image-models) - example: black-forest-labs/FLUX.1-schnell - anyOf: - - type: string - enum: - - black-forest-labs/FLUX.1-schnell-Free - - black-forest-labs/FLUX.1-schnell - - black-forest-labs/FLUX.1.1-pro - - type: string - steps: - type: integer - default: 20 - description: Number of generation steps. - image_url: - type: string - description: URL of an image to use for image models that support it. - seed: - type: integer - description: >- - Seed used for generation. Can be used to reproduce image - generations. - 'n': - type: integer - default: 1 - description: Number of image results to generate. - height: - type: integer - default: 1024 - description: Height of the image to generate in number of pixels. - width: - type: integer - default: 1024 - description: Width of the image to generate in number of pixels. - negative_prompt: - type: string - description: The prompt or prompts not to guide the image generation. - response_format: - type: string - description: >- - Format of the image response. Can be either a base64 string - or a URL. - enum: - - base64 - - url - guidance_scale: - type: number - description: >- - Adjusts the alignment of the generated image with the input - prompt. Higher values (e.g., 8-10) make the output more - faithful to the prompt, while lower values (e.g., 1-5) - encourage more creative freedom. - default: 3.5 - output_format: - type: string - description: >- - The format of the image response. Can be either be `jpeg` or - `png`. Defaults to `jpeg`. - default: jpeg - enum: - - jpeg - - png - image_loras: - description: >- - An array of objects that define LoRAs (Low-Rank Adaptations) - to influence the generated image. - type: array - items: - type: object - required: - - path - - scale - properties: - path: - type: string - description: >- - The URL of the LoRA to apply (e.g. - https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA). - scale: - type: number - description: >- - The strength of the LoRA's influence. Most LoRA's - recommend a value of 1. - reference_images: - description: >- - An array of image URLs that guide the overall appearance and - style of the generated image. These reference images - influence the visual characteristics consistently across the - generation. - type: array - items: - type: string - description: URL of a reference image to guide the image generation. - disable_safety_checker: - type: boolean - description: If true, disables the safety checker for image generation. + $ref: '#/components/schemas/DE.UpdateShadowExperimentTargetRequest' + required: true responses: - '200': - description: Image generated successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/ImageResponse' - /files: + $ref: '#/components/schemas/DE.ShadowExperimentTarget' + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' get: - tags: - - Files - summary: List all files - description: List the metadata for all uploaded data files. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.files.list() - - for file in response.data: - print(file.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.files.list() - - for file in response.data: - print(file.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.list(); - - for (const file of response.data) { - console.log(file.id); - } - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.list(); - - for (const file of response.data) { - console.log(file.id); - } - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/files" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + tags: [ShadowExperimentService] + summary: Get a shadow experiment target + description: Retrieves one target configured to receive mirrored requests from a shadow experiment. + operationId: ShadowExperimentService_GetTarget + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: experimentId + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string + - name: id + in: path + required: true + schema: + description: Shadow experiment target identifier. + type: string responses: - '200': - description: List of files + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FileList' - /files/{id}: - get: - tags: - - Files - summary: Retrieve file metadata - description: Retrieve the metadata for a single uploaded data file. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = client.files.retrieve(id="file-id") - - print(file) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = client.files.retrieve(id="file-id") - - print(file) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const file = await client.files.retrieve("file-id"); - - console.log(file); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const file = await client.files.retrieve("file-id"); - - console.log(file); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/files/ID" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + $ref: '#/components/schemas/DE.ShadowExperimentTarget' + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + delete: + tags: [ShadowExperimentService] + summary: Delete a shadow experiment target + description: Removes a target from a shadow experiment without deleting the underlying deployment. + operationId: ShadowExperimentService_DeleteTarget + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: endpointId + in: path + required: true + schema: + description: Endpoint identifier. + type: string + - name: experimentId + in: path + required: true + schema: + description: Shadow experiment identifier. + type: string - name: id in: path required: true schema: - description: The ID of the file to retrieve + description: Shadow experiment target identifier. type: string + - name: etag + in: query + schema: + type: string + description: Etag for optimistic concurrency. responses: - '200': - description: File retrieved successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FileResponse' - delete: - tags: - - Files - summary: Delete a file - description: Delete a previously uploaded data file. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.files.delete(id="file-id") - - print(response) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.files.delete(id="file-id") - - print(response) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.delete("file-id"); - - console.log(response); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.delete("file-id"); - - console.log(response); - - lang: Shell - label: cURL - source: | - curl -X "DELETE" "https://api.together.ai/v1/files/file-id" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" + $ref: '#/components/schemas/DE.DeleteResponse' + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{id}/analytics: + get: + tags: [EndpointService] + summary: Get endpoint analytics + description: Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. + operationId: EndpointService_GetEndpointAnalytics + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: The ID of the file to delete + description: Endpoint identifier. + type: string + - name: deploymentId + in: query + schema: + type: string + description: Restrict to a single deployment under this endpoint. + - name: startTime + in: query + schema: + type: string + format: date-time + description: Inclusive start of the time range. Defaults to 24 hours ago if unset. + - name: endTime + in: query + schema: + type: string + format: date-time + description: Exclusive end of the time range. Defaults to now if unset. + - name: includeTimeSeries + in: query + schema: + type: boolean + description: When true, include per-bucket time series in the response. + - name: granularity + in: query + schema: type: string + description: Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`. responses: - '200': - description: File deleted successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FileDeleteResponse' - /files/{id}/content: + $ref: '#/components/schemas/DE.AnalyticsData' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/endpoints/{id}/events: get: - tags: - - Files - summary: Get file contents - description: Get the contents of a single uploaded data file. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: > - # Docs for v1 can be found by changing the above selector ^ - - from together import Together - - import os - - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - - with client.files.with_streaming_response.content(id="file-id") as - response: - for line in response.iter_lines(): - print(line) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = client.files.retrieve_content(id="file-id") - - print(file.filename) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.content("file-id"); - const content = await response.text(); - - console.log(content); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.files.content("file-id"); - const content = await response.text(); - - console.log(content); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/files/file-id/content" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + tags: [EndpointService] + summary: List endpoint events + description: Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. + operationId: EndpointService_ListEndpointEvents + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: The ID of the file to get the content of + description: Endpoint identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of events to return. Max 500, defaults to 50. + - name: after + in: query + schema: + type: string + description: Cursor from a previous endpoint event list response. + - name: types + in: query + schema: + type: array + items: + type: string + description: Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND. + - name: minLevel + in: query + schema: + enum: + - LEVEL_DEBUG + - LEVEL_INFO + - LEVEL_WARN + - LEVEL_ERROR + type: string + description: Minimum severity. Omit to disable severity filtering. + - name: since + in: query + schema: + type: string + format: date-time + description: Return only events at or after this time. + - name: until + in: query + schema: + type: string + format: date-time + description: Return only events strictly before this time. + - name: deploymentIds + in: query + schema: + type: array + items: + type: string + description: Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`. + - name: sourceKinds + in: query + schema: + type: array + items: + enum: + - SOURCE_KIND_ENDPOINT + - SOURCE_KIND_DEPLOYMENT + type: string + description: Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events. + - name: subjectId + in: query + schema: type: string + description: ID of a subject associated with the event, such as a rollout. Combined with other filters using AND. responses: - '200': - description: File content retrieved successfully + "200": + description: OK content: - text/plain: + application/json: schema: - type: string - format: binary - '500': - description: Internal Server Error + $ref: '#/components/schemas/DE.ListEndpointEventsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/models: + get: + tags: [VolumeService] + summary: List project models + description: Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. + operationId: VolumeService_ListModels + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: visibility + in: query + schema: + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization. + - name: organizationId + in: query + schema: + type: string + description: Organization whose shared models should be included. Defaults to the authenticated project's organization. + - name: limit + in: query + schema: + type: integer + description: Maximum number of models to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous model list response. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.ListModelsResponse' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /files/upload: post: - tags: - - Files - summary: Upload a file - description: Upload a file with specified purpose, file name, and file type. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - current_dir = os.path.dirname(os.path.abspath(__file__)) - file_path = os.path.join(current_dir, "data.jsonl") - file = client.files.upload(file=file_path) - - print(file.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - current_dir = os.path.dirname(os.path.abspath(__file__)) - file_path = os.path.join(current_dir, "data.jsonl") - file = client.files.upload(file=file_path) - - print(file.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import { upload } from "together-ai/lib/upload" - import path from "path"; - import { fileURLToPath } from "url"; - - const __filename = fileURLToPath(import.meta.url); - const __dirname = path.dirname(__filename); - const filepath = path.join(__dirname, "data.jsonl"); - const file = await upload(filepath); - - console.log(file.id); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import { upload } from "together-ai/lib/upload" - import path from "path"; - import { fileURLToPath } from "url"; - - const __filename = fileURLToPath(import.meta.url); - const __dirname = path.dirname(__filename); - const filepath = path.join(__dirname, "data.jsonl"); - const file = await upload(filepath); - - console.log(file.id); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/files/upload" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -F "file=@/path/to/data.jsonl" \ - -F "file_name=data.jsonl" \ - -F "purpose=fine-tune" + tags: [VolumeService] + summary: Create a model + description: Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. + operationId: VolumeService_CreateModel + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string requestBody: - required: true content: - multipart/form-data: + application/json: schema: - type: object - required: - - purpose - - file_name - - file - properties: - purpose: - $ref: '#/components/schemas/FilePurpose' - file_name: - type: string - description: The name of the file being uploaded - example: dataset.csv - file_type: - $ref: '#/components/schemas/FileType' - file: - type: string - format: binary - description: The content of the file being uploaded + $ref: '#/components/schemas/DE.CreateModelRequest' + required: true responses: - '200': - description: File uploaded successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FileResponse' - '400': - description: Bad Request + $ref: '#/components/schemas/DE.Model' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + /projects/{projectId}/models/{id}: + get: + tags: [VolumeService] + summary: Get a model + description: Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. + operationId: VolumeService_GetModel + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: id + in: path + required: true + schema: + description: Model identifier. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.Model' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '500': - description: Internal Server Error + delete: + tags: [VolumeService] + summary: Delete a model + description: Permanently deletes a custom model resource. The model must not be in use by an active deployment. + operationId: VolumeService_DeleteModel + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: ID of the project that owns the model. + type: string + - name: id + in: path + required: true + schema: + description: Model identifier. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.DeleteResponse' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /fine-tunes: - post: - tags: - - Fine-tuning - summary: Create job - description: Create a fine-tuning job with the provided model and training data. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.create( - model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", - training_file="file-id" - ) - - print(response) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.create( - model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", - training_file="file-id" - ) - - print(response) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.create({ - model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", - training_file: "file-id", - }); - - console.log(response); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.create({ - model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", - training_file: "file-id", - }); - - console.log(response); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/fine-tunes" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", - "training_file": "file-id" - }' + patch: + tags: [VolumeService] + summary: Update a model + description: Updates mutable model metadata such as its inference name, description, base model, or visibility. + operationId: VolumeService_UpdateModel + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: id + in: path + required: true + schema: + description: Model identifier. + type: string + - name: updateMask + in: query + schema: + type: string + format: field-mask + description: Fields to update. If omitted, all mutable fields are overwritten. requestBody: - required: true content: application/json: schema: - type: object - required: - - training_file - - model - properties: - training_file: - type: string - description: File-ID of a training file uploaded to the Together API - validation_file: - type: string - description: File-ID of a validation file uploaded to the Together API - packing: - type: boolean - default: true - description: Whether to use sequence packing for training. - max_seq_length: - type: integer - description: >- - Maximum sequence length to use for training. If not - specified, the maximum allowed for the model and training - method will be used. - model: - type: string - description: Name of the base model to run fine-tune job on - n_epochs: - type: integer - default: 1 - description: >- - Number of complete passes through the training dataset - (higher values may improve results but increase cost and - risk of overfitting) - n_checkpoints: - type: integer - default: 1 - description: >- - Number of intermediate model versions saved during training - for evaluation - n_evals: - type: integer - default: 0 - description: >- - Number of evaluations to be run on a given validation set - during training - batch_size: - oneOf: - - type: integer - - type: string - enum: - - max - default: max - description: >- - Number of training examples processed together (larger - batches use more memory but may train faster). Defaults to - "max". We use training optimizations like packing, so the - effective batch size may be different than the value you - set. - gradient_accumulation_steps: - type: integer - default: 1 - description: >- - Number of steps to accumulate gradients before performing a - weight update. Effectively increases the batch size without - requiring more memory. For example, with batch_size=4 and - gradient_accumulation_steps=8, the effective batch size is - 32. - learning_rate: - type: number - format: float - default: 0.00001 - description: >- - Controls how quickly the model adapts to new information - (too high may cause instability, too low may slow - convergence) - lr_scheduler: - type: object - default: none - $ref: '#/components/schemas/LRScheduler' - description: >- - The learning rate scheduler to use. It specifies how the - learning rate is adjusted during training. - warmup_ratio: - type: number - format: float - default: 0 - description: >- - The percent of steps at the start of training to linearly - increase the learning rate. - max_grad_norm: - type: number - format: float - default: 1 - description: >- - Max gradient norm to be used for gradient clipping. Set to 0 - to disable. - weight_decay: - type: number - format: float - default: 0 - description: Weight decay. Regularization parameter for the optimizer. - random_seed: - type: integer - nullable: true - description: > - Random seed for reproducible training. When set, the same - seed produces the same run (e.g. data shuffle, init). If - omitted or null, the server applies its default seed (e.g. - 42). - suffix: - type: string - maxLength: 64 - description: >- - Suffix to add to your fine-tuned model name. Must be at most - 64 characters long. - wandb_api_key: - type: string - description: >- - Integration key for tracking experiments and model metrics - on W&B platform - wandb_base_url: - type: string - description: The base URL of a dedicated Weights & Biases instance. - wandb_project_name: - type: string - description: >- - The Weights & Biases project for your run. If not specified, - uses `together` as the project name. - wandb_name: - type: string - description: The Weights & Biases name for your run. - wandb_entity: - type: string - description: The Weights & Biases entity for your run. - train_on_inputs: - oneOf: - - type: boolean - - type: string - enum: - - auto - type: boolean - default: auto - description: >- - Whether to mask user messages in conversational data or - prompts in instruction data. - deprecated: true - training_method: - type: object - oneOf: - - $ref: '#/components/schemas/TrainingMethodSFT' - - $ref: '#/components/schemas/TrainingMethodDPO' - description: >- - The training method to use. 'sft' for Supervised Fine-Tuning - or 'dpo' for Direct Preference Optimization. - training_type: - type: object - default: null - nullable: true - anyOf: - - $ref: '#/components/schemas/FullTrainingType' - - $ref: '#/components/schemas/LoRATrainingType' - description: The training type to use. Defaults to LoRA if not provided. - multimodal_params: - $ref: '#/components/schemas/MultimodalParams' - from_checkpoint: - type: string - description: >- - The checkpoint identifier to continue training from a - previous fine-tuning job. Format is `{$JOB_ID}` or - `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or - `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; - without it, uses the final checkpoint. - from_hf_model: - type: string - description: >- - The Hugging Face Hub repo to start training from. Should be - as close as possible to the base model (specified by the - `model` argument) in terms of architecture and size. - hf_model_revision: - type: string - description: >- - The revision of the Hugging Face Hub model to continue - training from. E.g., hf_model_revision=main (default, used - if the argument is not provided) or - hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' - (specific commit). - hf_api_token: - type: string - description: The API token for the Hugging Face Hub. - hf_output_repo_name: - type: string - description: >- - The name of the Hugging Face repository to upload the - fine-tuned model to. + $ref: '#/components/schemas/DE.UpdateModelRequest' + required: true responses: - '200': - description: Fine-tuning job initiated successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneResponseTruncated' - get: - tags: - - Fine-tuning - summary: List all jobs - description: >- - List the metadata for all fine-tuning jobs. Returns a list of - FinetuneResponseTruncated objects. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.list() - - for fine_tune in response.data: - print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.list() - - for fine_tune in response.data: - print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.list(); - - for (const fineTune of response.data) { - console.log(fineTune.id, fineTune.status); - } - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.list(); - - for (const fineTune of response.data) { - console.log(fineTune.id, fineTune.status); - } - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/fine-tunes" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + $ref: '#/components/schemas/DE.Model' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/placement-profiles: + get: + tags: [PlacementProfileService] + summary: List placement profiles + description: Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. + operationId: PlacementProfileService_ListPlacementProfiles + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of profiles to return. Max 500, defaults to 50. + - name: after + in: query + schema: + type: string + description: Cursor from a previous placement profile list response. responses: - '200': - description: List of fine-tune jobs + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneTruncatedList' - /fine-tunes/estimate-price: - post: - tags: - - Fine-tuning - summary: Estimate price - description: Estimate the price of a fine-tuning job. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - training_file - properties: - training_file: - type: string - description: File-ID of a training file uploaded to the Together API - validation_file: - type: string - description: File-ID of a validation file uploaded to the Together API - model: - type: string - description: Name of the base model to run fine-tune job on - n_epochs: - type: integer - default: 1 - description: >- - Number of complete passes through the training dataset - (higher values may improve results but increase cost and - risk of overfitting) - n_evals: - type: integer - default: 0 - description: >- - Number of evaluations to be run on a given validation set - during training - training_method: - type: object - oneOf: - - $ref: '#/components/schemas/TrainingMethodSFT' - - $ref: '#/components/schemas/TrainingMethodDPO' - description: >- - The training method to use. 'sft' for Supervised Fine-Tuning - or 'dpo' for Direct Preference Optimization. - training_type: - type: object - default: null - nullable: true - oneOf: - - $ref: '#/components/schemas/FullTrainingType' - - $ref: '#/components/schemas/LoRATrainingType' - description: The training type to use. Defaults to LoRA if not provided. - from_checkpoint: - type: string - description: >- - The checkpoint identifier to continue training from a - previous fine-tuning job. Format is `{$JOB_ID}` or - `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or - `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; - without it, uses the final checkpoint. + $ref: '#/components/schemas/DE.ListPlacementProfilesResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/placement-profiles/{id}: + get: + tags: [PlacementProfileService] + summary: Get a placement profile + description: Retrieves a reusable placement profile and its ordered region preferences. + operationId: PlacementProfileService_GetPlacementProfile + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: id + in: path + required: true + schema: + description: Placement profile identifier. + type: string responses: - '200': - description: Price estimated successfully + "200": + description: OK content: application/json: schema: - type: object - properties: - estimated_total_price: - type: number - description: The price of the fine-tuning job - allowed_to_proceed: - type: boolean - description: >- - Whether you are allowed to proceed with the fine-tuning - job. - example: true - user_limit: - type: number - description: Your credit limit in dollars. - estimated_train_token_count: - type: number - description: The estimated number of tokens to be trained - estimated_eval_token_count: - type: number - description: The estimated number of tokens for evaluation - '500': - description: Internal Server Error + $ref: '#/components/schemas/DE.PlacementProfile' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /fine-tunes/{id}: + /projects/{projectId}/models/{id}/files: get: - tags: - - Fine-tuning - summary: List job - description: List the metadata for a single fine-tuning job. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - fine_tune = client.fine_tuning.retrieve(id="ft-id") - - print(fine_tune) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - fine_tune = client.fine_tuning.retrieve(id="ft-id") - - print(fine_tune) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const fineTune = await client.fineTuning.retrieve("ft-id"); - - console.log(fineTune); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const fineTune = await client.fineTuning.retrieve("ft-id"); - - console.log(fineTune); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/fine-tunes/ft-id" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + tags: [VolumeService] + summary: List model files + description: Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. + operationId: VolumeService_ListModelFiles + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: The ID of the job to retrieve + description: Model identifier. + type: string + - name: revisionId + in: query + schema: type: string + description: Revision identifier to read from. responses: - '200': - description: Fine-tune job details retrieved successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneResponse' - delete: - tags: - - Fine-tuning - summary: Delete a fine-tune job - description: Delete a fine-tuning job. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.delete(id="ft-id") - - print(response) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.delete(id="ft-id") - - print(response) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.delete("ft-id"); - - console.log(response); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.delete("ft-id"); - - console.log(response); - - lang: Shell - label: cURL - source: > - curl -X "DELETE" - "https://api.together.ai/v1/fine-tunes/ft-id?force=false" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + $ref: '#/components/schemas/DE.ListFilesResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/models/{id}/revisions: + get: + tags: [VolumeService] + summary: List model revisions + description: Lists the immutable file revisions available for a custom model, newest first. + operationId: VolumeService_ListModelRevisions + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: The ID of the fine-tune job to delete + description: Project identifier. type: string - - name: force - deprecated: true - in: query + - name: id + in: path + required: true schema: - description: Deprecated and unused parameter. - type: boolean - default: false + description: Model identifier. + type: string responses: - '200': - description: Fine-tune job deleted successfully + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneDeleteResponse' - '404': - description: Fine-tune job not found + $ref: '#/components/schemas/DE.ListRevisionsResponse' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '500': - description: Internal server error + /projects/{projectId}/models/{id}/revisions/{revisionId}: + get: + tags: [VolumeService] + summary: Get a model volume revision + description: Retrieves metadata for one immutable revision of a custom model's files. + operationId: VolumeService_GetRevisionByModelType + servers: + - url: https://api.together.ai/v2 + parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string + - name: id + in: path + required: true + schema: + description: Model identifier. + type: string + - name: revisionId + in: path + required: true + schema: + description: Revision identifier. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.ListRevisionsResponseRevision' + default: + description: Default error response content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /fine-tunes/{id}/events: + /projects/{projectId}/models/uploads: get: - tags: - - Fine-tuning - summary: List job events - description: List the events for a single fine-tuning job. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.list_events(id="ft-id") - - for event in response.data: - print(event) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - events = client.fine_tuning.list_events(id="ft-id") - - print(events) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const events = await client.fineTuning.listEvents("ft-id"); - - console.log(events); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const events = await client.fineTuning.listEvents("ft-id"); - - console.log(events); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/fine-tunes/ft-id/events" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + tags: [VolumeService] + summary: List remote model uploads + description: Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. + operationId: VolumeService_ListRemoteModelUploads + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: The ID of the fine-tune job to list events for + description: Project identifier. + type: string + - name: limit + in: query + schema: + type: integer + description: Maximum number of uploads to return. + - name: after + in: query + schema: type: string + description: Cursor from a previous remote upload list response. responses: - '200': - description: List of fine-tune events + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneListEvents' - /fine-tunes/{id}/checkpoints: - get: - tags: - - Fine-tuning - summary: List checkpoints - description: List the checkpoints for a single fine-tuning job. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - checkpoints = client.fine_tuning.list_checkpoints(id="ft-id") - - print(checkpoints) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - checkpoints = client.fine_tuning.list_checkpoints(id="ft-id") - - print(checkpoints) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const checkpoints = await - client.fineTuning.listCheckpoints("ft-id"); - - - console.log(checkpoints); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const checkpoints = await - client.fineTuning.listCheckpoints("ft-id"); - - - console.log(checkpoints); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/fine-tunes/ft-id/checkpoints" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + $ref: '#/components/schemas/DE.ListRemoteUploadsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + post: + tags: [VolumeService] + summary: Create a remote model upload + description: Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. + operationId: VolumeService_CreateRemoteModelUpload + servers: + - url: https://api.together.ai/v2 parameters: - - name: id + - name: projectId in: path required: true schema: - description: The ID of the fine-tune job to list checkpoints for + description: Project identifier. type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DE.CreateRemoteUploadSpec' + required: true responses: - '200': - description: List of fine-tune checkpoints + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneListCheckpoints' - /finetune/download: + $ref: '#/components/schemas/DE.RemoteUpload' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/models/uploads/{id}: get: - tags: - - Fine-tuning - summary: Download model - description: Receive a compressed fine-tuned model or checkpoint. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: > - # Docs for v1 can be found by changing the above selector ^ - - from together import Together - - import os - - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - - # Using `with_streaming_response` gives you control to do what you - want with the response. - - stream = - client.fine_tuning.with_streaming_response.content(ft_id="ft-id") - - - with stream as response: - for line in response.iter_lines(): - print(line) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - # This will download the content to a location on disk - response = client.fine_tuning.download(id="ft-id") - - print(response) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.content({ - ft_id: "ft-id", - }); - - console.log(await response.blob()); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.content({ - ft_id: "ft-id", - }); - - console.log(await response.blob()); - - lang: Shell - label: cURL - source: > - curl - "https://api.together.ai/v1/finetune/download?ft_id=ft-id&checkpoint=merged" - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" + tags: [VolumeService] + summary: Get a remote model upload + description: Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. + operationId: VolumeService_GetRemoteModelUpload + servers: + - url: https://api.together.ai/v2 parameters: - - in: query - name: ft_id + - name: projectId + in: path required: true schema: - description: Fine-tune ID to download. A string that starts with `ft-`. - type: string - - in: query - name: checkpoint_step - required: false - schema: - description: >- - Specifies step number for checkpoint to download. Ignores - `checkpoint` value if set. - type: integer - - in: query - name: checkpoint - schema: - description: >- - Specifies checkpoint type to download - `merged` vs `adapter`. - This field is required if the checkpoint_step is not set. + description: Project identifier. type: string - enum: - - merged - - adapter - - model_output_path - responses: - '200': - description: Successfully downloaded the fine-tuned model or checkpoint. - content: - application/octet-stream: - schema: - type: string - format: binary - '400': - description: Invalid request parameters. - '404': - description: Fine-tune ID not found. - /fine-tunes/{id}/cancel: - post: - tags: - - Fine-tuning - summary: Cancel job - description: >- - Cancel a currently running fine-tuning job. Returns a - FinetuneResponseTruncated object. - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.cancel(id="ft-id") - - print(response) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.fine_tuning.cancel(id="ft-id") - - print(response) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.cancel("ft-id"); - - console.log(response); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.fineTuning.cancel("ft-id"); - - console.log(response); - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/fine-tunes/ft-id/cancel" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - parameters: - name: id in: path required: true schema: - description: Fine-tune ID to cancel. A string that starts with `ft-`. + description: Remote upload identifier. type: string responses: - '200': - description: Successfully cancelled the fine-tuning job. + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FinetuneResponseTruncated' - '400': - description: Invalid request parameters. - '404': - description: Fine-tune ID not found. - /fine-tunes/{id}/metrics: + $ref: '#/components/schemas/DE.RemoteUpload' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /projects/{projectId}/models/uploads/{id}/events: get: - tags: - - Fine-tuning - summary: Get metrics - description: > - Retrieves recorded training metrics for a fine-tuning job in - chronological order. All query parameters are optional: omit them to - retrieve all metrics. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl -X GET - "https://api.together.ai/v1/fine-tunes/ft-id/metrics?global_step_from=0&global_step_to=500" - \ - -H "Authorization: Bearer $TOGETHER_API_KEY" + tags: [VolumeService] + summary: List remote model upload events + description: Lists progress and diagnostic events for a remote model import job. + operationId: VolumeService_ListRemoteModelUploadEvents + servers: + - url: https://api.together.ai/v2 parameters: + - name: projectId + in: path + required: true + schema: + description: Project identifier. + type: string - name: id in: path required: true schema: - description: Fine-tune job ID. A string that starts with `ft-`. + description: Remote upload identifier. type: string - - name: global_step_from + - name: limit in: query - required: false schema: type: integer - format: int64 - description: Return only metrics with global_step >= this value. - example: 0 - - name: global_step_to + description: Maximum number of events to return. + - name: after + in: query + schema: + type: string + description: Cursor from a previous remote upload event list response. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.ListRemoteUploadEventsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /public/endpoints: + get: + tags: [EndpointService] + summary: List public endpoints + description: Lists endpoints that are publicly visible across Together projects. + operationId: EndpointService_ListPublicEndpoints + servers: + - url: https://api.together.ai/v2 + parameters: + - name: limit in: query - required: false schema: type: integer - format: int64 - description: Return only metrics with global_step <= this value. - example: 500 - - name: logged_at_from + description: Maximum number of results to return. + - name: after in: query - required: false schema: type: string - format: date-time - description: Return only metrics logged at or after this ISO-8601 timestamp. - example: '2024-01-01T00:00:00Z' - - name: logged_at_to + description: Cursor from a previous list response. + - name: orderBy in: query - required: false schema: type: string - format: date-time - description: Return only metrics logged at or before this ISO-8601 timestamp. - example: '2024-01-01T12:00:00Z' - - name: resolution + description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`. + - name: filter in: query - required: false schema: - type: integer - format: int64 - description: Number of (uniformly sampled) train metrics to return. - example: 100 + type: string + description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint name. responses: - '200': - description: List of metrics snapshots in chronological order. + "200": + description: OK content: application/json: schema: - type: object - properties: - metrics: - type: array - items: - type: object - additionalProperties: - type: number - description: A flat dictionary of scalar metric values. - example: - metrics: - - train/loss: 0.5 - train/learning_rate: 0.0001 - train/global_step: 7 - - train/loss: 0.45 - train/learning_rate: 0.00009 - train/global_step: 14 - '400': - description: 'Invalid request: bad JSON body or missing job ID.' - '404': - description: Fine-tune job not found. - '500': - description: 'Internal server error: failed to retrieve metrics.' - /fine-tunes/models/supported: + $ref: '#/components/schemas/DE.ListPublicEndpointsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /public/inference-instance-types: get: - tags: - - Fine-tuning - summary: List supported models - description: List models supported for fine-tuning. - x-codeSamples: - - lang: Shell - label: cURL (list all) - source: | - curl "https://api.together.ai/v1/fine-tunes/models/supported" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" + tags: [InstanceTypeService] + summary: List inference instance types + description: Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. + operationId: InstanceTypeService_ListInferenceInstanceTypes + servers: + - url: https://api.together.ai/v2 responses: - '200': - description: List of supported models. + "200": + description: OK content: application/json: schema: - type: object - required: - - models - properties: - models: - type: array - items: - type: string - description: List of supported model names. - /fine-tunes/models/limits: + $ref: '#/components/schemas/DE.ListInferenceInstanceTypesResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /public/inference-instance-types/{id}: get: - tags: - - Fine-tuning - summary: Get model limits - description: Get model limits for a specific fine-tuning model. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl - "https://api.together.ai/v1/fine-tunes/models/limits?model_name=meta-llama/Meta-Llama-3.1-8B-Instruct-Reference" - \ - -H "Authorization: Bearer $TOGETHER_API_KEY" + tags: [InstanceTypeService] + summary: Get an inference instance type + description: Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. + operationId: InstanceTypeService_GetInferenceInstanceType + servers: + - url: https://api.together.ai/v2 parameters: - - in: query - name: model_name + - name: id + in: path + required: true schema: + description: Resource identifier. type: string - description: The model name to get limits for. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.InferenceInstanceType' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + /supported-models: + get: + tags: [SupportedModelsService] + summary: List supported models + description: Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. + operationId: SupportedModelsService_ListSupportedModels + servers: + - url: https://api.together.ai/v2 + parameters: + - name: modality + in: query + schema: + description: Filter models by input modality. + enum: + - MODALITY_TEXT + - MODALITY_IMAGE + - MODALITY_AUDIO + - MODALITY_VIDEO + type: string + - name: product + in: query + schema: + description: Filter models by product surface. + enum: + - PRODUCT_SERVERLESS + - PRODUCT_DEDICATED + - PRODUCT_FINE_TUNING + type: string + - name: search + in: query + schema: + description: Case-insensitive search across model IDs, names, and descriptions. + type: string + - name: limit + in: query + schema: + description: Maximum number of models to return. + type: integer + - name: after + in: query + schema: + description: Cursor from a previous supported-model list response. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DE.ListSupportedModelsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /supported-models/{id}: + get: + tags: [SupportedModelsService] + summary: Get a supported model + description: Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. + operationId: SupportedModelsService_GetSupportedModel + servers: + - url: https://api.together.ai/v2 + parameters: + - name: id + in: path required: true + schema: + description: Supported model identifier. + type: string responses: - '200': - description: Model limits. + "200": + description: OK content: application/json: schema: - $ref: '#/components/schemas/FineTuneModelLimits' - '404': - description: Model not found or not supported for fine-tuning. + $ref: '#/components/schemas/DE.SupportedModel' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + /deployments: + get: + description: Get a list of all deployments in your project + summary: Get the list of deployments + tags: ['Deployments'] + responses: + "200": + description: List of deployments + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentListResponse" + "500": + description: Internal server error content: application/json: schema: type: object - properties: - message: - type: string - description: Error message explaining the model is not available. - /rerank: - post: - tags: - - Rerank - summary: Create a rerank request - description: >- - Rerank a list of documents by relevance to a query. Returns a relevance - score and ordering index for each document. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | - # Docs for v1 can be found by changing the above selector ^ from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) + client = Together() - documents = [ - { - "title": "Llama", - "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." - }, - { - "title": "Panda", - "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." - }, - { - "title": "Guanaco", - "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." - }, - { - "title": "Wild Bactrian camel", - "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." - } - ] + deployments = client.beta.jig.list() + print(deployments) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - response = client.rerank.create( - model="Salesforce/Llama-Rank-v1", - query="What animals can I find near Peru?", - documents=documents, - ) + const deployments = await client.beta.jig.list(); + console.log(deployments); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - for result in response.results: - print(f"Rank: {result.index + 1}") - print(f"Title: {documents[result.index]['title']}") - print(f"Text: {documents[result.index]['text']}") + const deployments = await client.beta.jig.list(); + console.log(deployments); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments + post: + description: Create a new deployment with specified configuration + summary: Create a new deployment + tags: ['Deployments'] + x-codeSamples: - lang: Python - label: Together AI SDK (v1) + label: Together AI SDK (v2) source: | from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - documents = [ - { - "title": "Llama", - "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." - }, - { - "title": "Panda", - "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." - }, - { - "title": "Guanaco", - "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." - }, - { - "title": "Wild Bactrian camel", - "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." - } - ] + client = Together() - response = client.rerank.create( - model="Salesforce/Llama-Rank-v1", - query="What animals can I find near Peru?", - documents=documents, + deployment = client.beta.jig.deploy( + name="my-deployment", + gpu_type="h100-80gb", + image="registry.together.ai/proj_abcdefg1234567890/my-image:latest" ) - - for result in response.results: - print(f"Rank: {result.index + 1}") - print(f"Title: {documents[result.index]['title']}") - print(f"Text: {documents[result.index]['text']}") + print(deployment) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; + const client = new Together(); - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, + const deployment = await client.beta.jig.deploy({ + name: "my-deployment", + gpu_type: "h100-80gb", + image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" }); - - const documents = [{ - "title": "Llama", - "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." - }, - { - "title": "Panda", - "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." - }, - { - "title": "Guanaco", - "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." - }, - { - "title": "Wild Bactrian camel", - "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." - }]; - - const response = await client.rerank.create({ - model: "Salesforce/Llama-Rank-v1", - query: "What animals can I find near Peru?", - documents, - }); - - for (const result of response.results) { - console.log(`Rank: ${result.index + 1}`); - console.log(`Title: ${documents[result.index].title}`); - console.log(`Text: ${documents[result.index].text}`); - } + console.log(deployment); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; + const client = new Together(); - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const documents = [{ - "title": "Llama", - "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." - }, - { - "title": "Panda", - "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." - }, - { - "title": "Guanaco", - "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." - }, - { - "title": "Wild Bactrian camel", - "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." - }]; - - const response = await client.rerank.create({ - model: "Salesforce/Llama-Rank-v1", - query: "What animals can I find near Peru?", - documents, + const deployment = await client.beta.jig.deploy({ + name: "my-deployment", + gpu_type: "h100-80gb", + image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" }); - - for (const result of response.results) { - console.log(`Rank: ${result.index + 1}`); - console.log(`Title: ${documents[result.index].title}`); - console.log(`Text: ${documents[result.index].text}`); - } - - lang: Shell - label: cURL - source: | - curl -X POST "https://api.together.ai/v1/rerank" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "Salesforce/Llama-Rank-v1", - "query": "What animals can I find near Peru?", - "documents": [{ - "title": "Llama", - "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." - }, - { - "title": "Panda", - "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." - }, - { - "title": "Guanaco", - "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." - }, - { - "title": "Wild Bactrian camel", - "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." - }] - }' - operationId: rerank + console.log(deployment); requestBody: content: application/json: schema: - $ref: '#/components/schemas/RerankRequest' + $ref: "#/components/schemas/CreateDeploymentRequest" + description: Deployment configuration + required: true responses: - '200': - description: '200' - content: - application/json: - schema: - $ref: '#/components/schemas/RerankResponse' - '400': - description: BadRequest + "200": + description: Deployment created successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + $ref: "#/components/schemas/DeploymentResponseItem" + "400": + description: Invalid request content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: NotFound + type: object + "500": + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + type: object + /deployments/{id}: + delete: + description: Delete an existing deployment + summary: Delete a deployment + tags: ['Deployments'] + parameters: + - name: id + in: path + required: true + schema: + description: Deployment ID or name + type: string + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + deployment = client.beta.jig.destroy("my-deployment") + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.destroy("my-deployment"); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.destroy("my-deployment"); + console.log(deployment); + - lang: Shell + label: cURL + source: | + curl -X DELETE \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/my-deployment + responses: + "200": + description: Deployment deleted successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '503': - description: Overloaded + type: object + "404": + description: Deployment not found content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '504': - description: Timeout + type: object + "500": + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - deprecated: false - /audio/speech: - post: - tags: - - Audio - summary: Create audio generation request - description: Generate audio from input text + type: object + get: + description: Retrieve details of a specific deployment by its ID or name + summary: Get a deployment by ID or name + tags: ['Deployments'] + parameters: + - name: id + in: path + required: true + schema: + description: Deployment ID or name + type: string x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | - # Docs for v1 can be found by changing the above selector ^ from together import Together - import os + client = Together() - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) + deployment = client.beta.jig.retrieve("my-deployment") + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - response = client.audio.speech.with_streaming_response.create( - model="cartesia/sonic-2", - input="The quick brown fox jumps over the lazy dog.", - voice="laidback woman", - ) + const deployment = await client.beta.jig.retrieve("my-deployment"); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - with response as stream: - stream.stream_to_file("audio.wav") + const deployment = await client.beta.jig.retrieve("my-deployment"); + console.log(deployment); + responses: + "200": + description: Deployment details + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentResponseItem" + "404": + description: Deployment not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + patch: + description: Update an existing deployment configuration + summary: Update a deployment + tags: ['Deployments'] + x-codeSamples: - lang: Python - label: Together AI SDK (v1) + label: Together AI SDK (v2) source: | from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.audio.speech.create( - model="cartesia/sonic-2", - input="The quick brown fox jumps over the lazy dog.", - voice="laidback woman", - ) + client = Together() - response.stream_to_file("audio.wav") + deployment = client.beta.jig.update("my-deployment", gpu_count=2) + print(deployment) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - import { createWriteStream } from "fs"; - import { join } from "path"; - import { pipeline } from "stream/promises"; + const client = new Together(); - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.audio.speech.create({ - model: "cartesia/sonic-2", - input: "The quick brown fox jumps over the lazy dog.", - voice: "laidback woman", - }); - - const filepath = join(process.cwd(), "audio.wav"); - const writeStream = createWriteStream(filepath); - - if (response.body) { - await pipeline(response.body, writeStream); - } + const deployment = await client.beta.jig.update("my-deployment", { gpu_count: 2 }); + console.log(deployment); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - import { createWriteStream } from "fs"; - import { join } from "path"; - import { pipeline } from "stream/promises"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const response = await client.audio.speech.create({ - model: "cartesia/sonic-2", - input: "The quick brown fox jumps over the lazy dog.", - voice: "laidback woman", - }); - - const filepath = join(process.cwd(), "audio.wav"); - const writeStream = createWriteStream(filepath); + const client = new Together(); - if (response.body) { - await pipeline(response.body, writeStream); - } + const deployment = await client.beta.jig.update("my-deployment", { gpu_count: 2 }); + console.log(deployment); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/audio/speech" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "cartesia/sonic-2", - "input": "The quick brown fox jumps over the lazy dog.", - "voice": "laidback woman" - }' \ - --output audio.wav - operationId: audio-speech + curl -X PATCH \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "gpu_count": 2 }' \ + https://api.together.ai/v1/deployments/my-deployment + parameters: + - name: id + in: path + required: true + schema: + description: Deployment ID or name + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/AudioSpeechRequest' + $ref: "#/components/schemas/UpdateDeploymentRequest" + description: Updated deployment configuration + required: true responses: - '200': - description: OK + "200": + description: Deployment updated successfully content: - application/octet-stream: - schema: - type: string - format: binary - audio/wav: - schema: - type: string - format: binary - audio/mpeg: + application/json: schema: - type: string - format: binary - text/event-stream: + $ref: "#/components/schemas/DeploymentResponseItem" + "400": + description: Invalid request + content: + application/json: schema: - $ref: '#/components/schemas/AudioSpeechStreamResponse' - '400': - description: BadRequest + type: object + "404": + description: Deployment not found content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + type: object + "500": + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /audio/speech/websocket: + type: object + /deployments/{id}/logs: get: - tags: - - Audio - summary: Real-time text-to-speech via WebSocket - description: > - Establishes a WebSocket connection for real-time text-to-speech - generation. This endpoint uses WebSocket protocol - (wss://api.together.ai/v1/audio/speech/websocket) for bidirectional - streaming communication. - + description: Retrieve logs from a deployment, optionally filtered by replica ID. + summary: Get logs for a deployment + tags: ['Deployments'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() - **Connection Setup:** + deployment = client.beta.jig.logs("my-deployment") + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - Protocol: WebSocket (wss://) + const deployment = await client.beta.jig.logs("my-deployment"); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - Authentication: Pass API key as Bearer token in Authorization header + const deployment = await client.beta.jig.logs("my-deployment"); + console.log(deployment); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/my-deployment/logs + parameters: + - name: id + in: path + required: true + schema: + description: Deployment ID or name + type: string + - name: replica_id + in: query + required: false + schema: + description: Replica ID to filter logs + type: string + - name: version + in: query + schema: + description: Deployment image version (tag or last 4 characters of image digest) to filter logs + type: string + - name: revision + in: query + schema: + description: Deployment revision (UUID) to filter logs + type: string + responses: + "200": + description: Deployment logs + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentLogs" + "404": + description: Deployment not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + /deployments/secrets: + get: + description: Retrieve all secrets in your project + summary: Get the list of project secrets + tags: ['Secrets'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() - - Parameters: Sent as query parameters (model, voice, - max_partial_length, language) + secrets = client.beta.jig.secrets.list() + print(secrets) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + const secrets = await client.beta.jig.secrets.list(); + console.log(secrets); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - **Client Events:** + const secrets = await client.beta.jig.secrets.list(); + console.log(secrets); + responses: + "200": + description: List of secrets + content: + application/json: + schema: + $ref: "#/components/schemas/ListSecretsResponse" + "500": + description: Internal server error + content: + application/json: + schema: + type: object + post: + description: Create a new secret to store sensitive configuration values + summary: Create a new secret + tags: ['Secrets'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() - - `tts_session.updated`: Update session parameters like voice. The - `session` object also accepts an `extra_params` field for additional - model-specific parameters that fine-tune speech generation behavior, - such as `pronunciation_dict` (a list of pronunciation rules for specific - characters or symbols, where each entry uses the format - `"/"` (e.g., `["omg/oh my god"]`) to override how - the model pronounces matching tokens). - ```json - { - "type": "tts_session.updated", - "session": { - "voice": "tara", - "extra_params": { - "pronunciation_dict": ["omg/oh my god"] - } - } - } - ``` - - `input_text_buffer.append`: Send text chunks for TTS generation - ```json - { - "type": "input_text_buffer.append", - "text": "Hello, this is a test." - } - ``` - - `input_text_buffer.clear`: Clear the buffered text - ```json - { - "type": "input_text_buffer.clear" - } - ``` - - `input_text_buffer.commit`: Signal end of text input and process - remaining text - ```json - { - "type": "input_text_buffer.commit" - } - ``` + client.beta.jig.secrets.create(name="my-secret", value="my-value") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - **Server Events:** + await client.beta.jig.secrets.create({ name: "my-secret", value: "my-value" }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - `session.created`: Initial session confirmation (sent first) - ```json - { - "event_id": "evt_123456", - "type": "session.created", - "session": { - "id": "session-id", - "object": "realtime.tts.session", - "modalities": ["text", "audio"], - "model": "hexgrad/Kokoro-82M", - "voice": "tara" - } - } - ``` - - `conversation.item.input_text.received`: Acknowledgment that text was - received - ```json - { - "type": "conversation.item.input_text.received", - "text": "Hello, this is a test." - } - ``` - - `conversation.item.audio_output.delta`: Audio chunks as base64-encoded - data - ```json - { - "type": "conversation.item.audio_output.delta", - "item_id": "tts_1", - "delta": "" - } - ``` - - `conversation.item.audio_output.done`: Audio generation complete for - an item - ```json - { - "type": "conversation.item.audio_output.done", - "item_id": "tts_1" - } - ``` - - `conversation.item.tts.failed`: Error occurred - ```json - { - "type": "conversation.item.tts.failed", - "error": { - "message": "Error description", - "type": "invalid_request_error", - "param": null, - "code": "invalid_api_key" - } - } - ``` - - **Text Processing:** - - - Partial text (no sentence ending) is held in buffer until: - - We believe that the text is complete enough to be processed for TTS generation - - The partial text exceeds `max_partial_length` characters (default: 250) - - The `input_text_buffer.commit` event is received - - **Audio Format:** - - - Format: Raw PCM (s16le, mono) - - - Sample Rate: 24000 Hz - - - Encoding: Base64 (per delta event) - - - Delivered via `conversation.item.audio_output.delta` events + await client.beta.jig.secrets.create({ name: "my-secret", value: "my-value" }); + - lang: Shell + label: cURL + source: | + curl -X POST \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "name": "my-secret", "value": "my-value" }' \ + https://api.together.ai/v1/deployments/secrets + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateSecretRequest" + description: Secret configuration + required: true + responses: + "200": + description: Secret created successfully + content: + application/json: + schema: + $ref: "#/components/schemas/SecretResponseItem" + "400": + description: Invalid request + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + /deployments/secrets/{id}: + delete: + description: Delete an existing secret + summary: Delete a secret + tags: ['Secrets'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + client.beta.jig.secrets.delete("my-secret") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - **Error Codes:** + await client.beta.jig.secrets.delete("my-secret"); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - `invalid_api_key`: Invalid API key provided (401) + await client.beta.jig.secrets.delete("my-secret"); + - lang: Shell + label: cURL + source: | + curl -X DELETE \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/secrets/my-secret + parameters: + - name: id + in: path + required: true + schema: + description: Secret ID or name + type: string + responses: + "200": + description: Secret deleted successfully + content: + application/json: + schema: + type: object + "404": + description: Secret not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + get: + description: Retrieve details of a specific secret by its ID or name + summary: Get a secret by ID or name + tags: ['Secrets'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() - - `missing_api_key`: Authorization header missing (401) + secret = client.beta.jig.secrets.retrieve("my-secret") + print(secret) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - `model_not_available`: Invalid or unavailable model (400) + const secret = await client.beta.jig.secrets.retrieve("my-secret"); + console.log(secret); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - - Invalid text format errors (400) - operationId: realtime-tts + const secret = await client.beta.jig.secrets.retrieve("my-secret"); + console.log(secret); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/secrets/my-secret + parameters: + - name: id + in: path + required: true + schema: + description: Secret ID or name + type: string + responses: + "200": + description: Secret details + content: + application/json: + schema: + $ref: "#/components/schemas/SecretResponseItem" + "404": + description: Secret not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + patch: + description: Update an existing secret's value or metadata + summary: Update a secret + tags: ['Secrets'] x-codeSamples: - lang: Python - label: Python WebSocket Client + label: Together AI SDK (v2) source: | - import asyncio - import websockets - import json - import base64 - import os - - async def generate_speech(): - api_key = os.environ.get("TOGETHER_API_KEY") - url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart" - - headers = { - "Authorization": f"Bearer {api_key}" - } + from together import Together + client = Together() - async with websockets.connect(url, additional_headers=headers) as ws: - # Wait for session created - session_msg = await ws.recv() - session_data = json.loads(session_msg) - if session_data.get("type") != "session.created": - print(f"Failed to start session: {session_data}") - return - print(f"Session created: {session_data['session']['id']}") + client.beta.jig.secrets.update("my-secret", value="my-new-value") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); - # Send text for TTS - text_chunks = [ - "Hello, this is a test.", - "This is the second sentence.", - "And this is the final one." - ] + await client.beta.jig.secrets.update("my-secret", { value: "my-new-value" }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); - async def send_text(): - for chunk in text_chunks: - await ws.send(json.dumps({ - "type": "input_text_buffer.append", - "text": chunk - })) - await asyncio.sleep(0.5) # Simulate typing + await client.beta.jig.secrets.update("my-secret", { value: "my-new-value" }); + - lang: Shell + label: cURL + source: | + curl -X PATCH \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "value": "my-new-value" }' \ + https://api.together.ai/v1/deployments/secrets/my-secret - # Commit to process any remaining text - await ws.send(json.dumps({ - "type": "input_text_buffer.commit" - })) - - async def receive_audio(): - audio_data = bytearray() - async for message in ws: - data = json.loads(message) - - if data["type"] == "conversation.item.input_text.received": - print(f"Text received: {data['text']}") - elif data["type"] == "conversation.item.audio_output.delta": - # Decode base64 audio chunk - audio_chunk = base64.b64decode(data['delta']) - audio_data.extend(audio_chunk) - print(f"Received audio chunk for item {data['item_id']}") - elif data["type"] == "conversation.item.audio_output.done": - print(f"Audio generation complete for item {data['item_id']}") - elif data["type"] == "conversation.item.tts.failed": - error = data.get("error", {}) - print(f"Error: {error.get('message')}") - break - - # Save the raw PCM samples to a file - with open("output.pcm", "wb") as f: - f.write(audio_data) - print("Audio saved to output.pcm") - - # Run send and receive concurrently - await asyncio.gather(send_text(), receive_audio()) - - asyncio.run(generate_speech()) - - lang: JavaScript - label: Node.js WebSocket Client - source: > - import WebSocket from 'ws'; - - import fs from 'fs'; - - - const apiKey = process.env.TOGETHER_API_KEY; - - const url = - 'wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart'; - - - const ws = new WebSocket(url, { - headers: { - 'Authorization': `Bearer ${apiKey}` - } - }); - - - const audioData = []; - - - ws.on('open', () => { - console.log('WebSocket connection established!'); - }); - - - ws.on('message', (data) => { - const message = JSON.parse(data.toString()); - - if (message.type === 'session.created') { - console.log(`Session created: ${message.session.id}`); - - // Send text chunks - const textChunks = [ - "Hello, this is a test.", - "This is the second sentence.", - "And this is the final one." - ]; - - textChunks.forEach((text, index) => { - setTimeout(() => { - ws.send(JSON.stringify({ - type: 'input_text_buffer.append', - text: text - })); - }, index * 500); - }); - - // Commit after all chunks - setTimeout(() => { - ws.send(JSON.stringify({ - type: 'input_text_buffer.commit' - })); - }, textChunks.length * 500 + 100); - - } else if (message.type === 'conversation.item.input_text.received') { - console.log(`Text received: ${message.text}`); - } else if (message.type === 'conversation.item.audio_output.delta') { - // Decode base64 audio chunk - const audioChunk = Buffer.from(message.delta, 'base64'); - audioData.push(audioChunk); - console.log(`Received audio chunk for item ${message.item_id}`); - } else if (message.type === 'conversation.item.audio_output.done') { - console.log(`Audio generation complete for item ${message.item_id}`); - } else if (message.type === 'conversation.item.tts.failed') { - const errorMessage = message.error?.message ?? 'Unknown error'; - console.error(`Error: ${errorMessage}`); - ws.close(); - } - }); - - - ws.on('close', () => { - // Save the raw PCM samples to a file - if (audioData.length > 0) { - const completeAudio = Buffer.concat(audioData); - fs.writeFileSync('output.pcm', completeAudio); - console.log('Audio saved to output.pcm'); - } - }); - - - ws.on('error', (error) => { - console.error('WebSocket error:', error); - }); parameters: - - in: query - name: model - required: false + - name: id + in: path + required: true schema: - description: >- - The TTS model to use for speech generation. Can also be set via - `tts_session.updated` event. + description: Secret ID or name type: string - enum: - - hexgrad/Kokoro-82M - - cartesia/sonic-english - default: hexgrad/Kokoro-82M - - in: query - name: voice - required: false + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateSecretRequest" + description: Updated secret configuration + required: true + responses: + "200": + description: Secret updated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/SecretResponseItem" + "400": + description: Invalid request + content: + application/json: + schema: + type: object + "404": + description: Secret not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + /deployments/storage/{filename}: + get: + description: Download a file by redirecting to a signed URL + summary: Download a file + tags: ['DeploymentsStorage'] + parameters: + - name: filename + in: path + required: true schema: + description: Filename type: string - description: > - The voice to use for speech generation. Default is 'tara'. - - Available voices vary by model. Can also be updated via - `tts_session.updated` event. - - in: query - name: max_partial_length - required: false - schema: - type: integer - default: 250 - description: > - Maximum number of characters in partial text before forcing TTS - generation - - even without a sentence ending. Helps reduce latency for long text - without punctuation. - - in: query - name: language - required: false + responses: + "307": + description: Redirect to signed download URL + content: + application/json: + schema: + type: string + "400": + description: Invalid request + content: + application/json: + schema: + additionalProperties: + type: string + type: object + "404": + description: File not found + content: + application/json: + schema: + additionalProperties: + type: string + type: object + "500": + description: Internal error + content: + application/json: + schema: + additionalProperties: + type: string + type: object + /deployments/storage/{filename}/url: + get: + description: Create a signed URL for downloading a deployment storage file + summary: Get a file download URL + tags: ['DeploymentsStorage'] + parameters: + - name: filename + in: path + required: true schema: + description: Filename type: string - default: en - example: en - description: > - Language or locale of input text. Accepts ISO 639-1 language codes - (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for - region-specific variants. Locale codes must be lowercase (e.g., - `zh-hk` for Cantonese). Can also be set via `tts_session.updated` - event. responses: - '101': - description: | - Switching Protocols - WebSocket connection established successfully. + "200": + description: Signed URL + content: + application/json: + schema: + $ref: "#/components/schemas/SignedURLResponse" + "400": + description: Invalid request + content: + application/json: + schema: + additionalProperties: + type: string + type: object + "404": + description: File not found + content: + application/json: + schema: + additionalProperties: + type: string + type: object + "500": + description: Internal error + content: + application/json: + schema: + additionalProperties: + type: string + type: object + /deployments/storage/volumes: + get: + description: Retrieve all volumes in your project + summary: Get the list of project volumes + tags: ['DeploymentsVolumes'] + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() - Error message format: - ```json - { - "type": "conversation.item.tts.failed", - "error": { - "message": "Error description", - "type": "invalid_request_error", - "param": null, - "code": "error_code" - } - } - ``` - /audio/transcriptions: - post: - tags: - - Audio - summary: Create audio transcription request - description: Transcribes audio into text - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = open("audio.wav", "rb") - - response = client.audio.transcriptions.create( - model="openai/whisper-large-v3", - file=file, - ) - - print(response.text) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = open("audio.wav", "rb") - - response = client.audio.transcriptions.create( - model="openai/whisper-large-v3", - file=file, - ) - - print(response.text) + volumes = client.beta.jig.storage.volumes.list() + print(volumes) - lang: TypeScript label: Together AI SDK (TypeScript) - source: > + source: | import Together from "together-ai"; + const client = new Together(); - import { readFileSync } from "fs"; - - import { join } from "path"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const audioFilePath = join(process.cwd(), "audio.wav"); - - const audioBuffer = readFileSync(audioFilePath); - - const audioFile = new File([audioBuffer], "audio.wav", { type: - "audio/wav" }); - - - const response = await client.audio.transcriptions.create({ - model: "openai/whisper-large-v3", - file: audioFile, - }); - - - console.log(response.text); + const volumes = await client.beta.jig.storage.volumes.list(); + console.log(volumes); - lang: JavaScript label: Together AI SDK (JavaScript) - source: > + source: | import Together from "together-ai"; + const client = new Together(); - import { readFileSync } from "fs"; - - import { join } from "path"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const audioFilePath = join(process.cwd(), "audio.wav"); - - const audioBuffer = readFileSync(audioFilePath); - - const audioFile = new File([audioBuffer], "audio.wav", { type: - "audio/wav" }); - - - const response = await client.audio.transcriptions.create({ - model: "openai/whisper-large-v3", - file: audioFile, - }); - - - console.log(response.text); + const volumes = await client.beta.jig.storage.volumes.list(); + console.log(volumes); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/audio/transcriptions" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -F "file=@audio.wav" \ - -F "model=openai/whisper-large-v3" - operationId: audio-transcriptions - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/AudioTranscriptionRequest' + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/storage/volumes responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AudioTranscriptionResponse' - '400': - description: BadRequest - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + "200": + description: List of volumes content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + $ref: "#/components/schemas/ListVolumesResponse" + "500": + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /audio/translations: + type: object post: - tags: - - Audio - summary: Create audio translation request - description: Translates audio into English + description: Create a new volume to preload files in deployments + summary: Create a new volume + tags: ['DeploymentsVolumes'] x-codeSamples: - lang: Python label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = open("audio.wav", "rb") - - response = client.audio.translations.create( - model="openai/whisper-large-v3", - file=file, - language="es", - ) - - print(response.text) - - lang: Python - label: Together AI SDK (v1) source: | from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - file = open("audio.wav", "rb") - - response = client.audio.translations.create( - model="openai/whisper-large-v3", - file=file, - language="es", - ) + client = Together() - print(response.text) + volumes = client.beta.jig.volumes.create(name="my-volume") + print(volumes) - lang: TypeScript label: Together AI SDK (TypeScript) - source: > + source: | import Together from "together-ai"; + const client = new Together(); - import { readFileSync } from "fs"; - - import { join } from "path"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const audioFilePath = join(process.cwd(), "audio.wav"); - - const audioBuffer = readFileSync(audioFilePath); - - const audioFile = new File([audioBuffer], "audio.wav", { type: - "audio/wav" }); - - - const response = await client.audio.translations.create({ - model: "openai/whisper-large-v3", - file: audioFile, - language: "es" - }); - - - console.log(response.text); + const volumes = await client.beta.jig.volumes.create({ name: "my-volume" }); + console.log(volumes); - lang: JavaScript label: Together AI SDK (JavaScript) - source: > + source: | import Together from "together-ai"; + const client = new Together(); - import { readFileSync } from "fs"; - - import { join } from "path"; - - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - - const audioFilePath = join(process.cwd(), "audio.wav"); - - const audioBuffer = readFileSync(audioFilePath); - - const audioFile = new File([audioBuffer], "audio.wav", { type: - "audio/wav" }); - - - const response = await client.audio.translations.create({ - model: "openai/whisper-large-v3", - file: audioFile, - language: "es" - }); - - - console.log(response.text); + const volumes = await client.beta.jig.volumes.create({ name: "my-volume" }); + console.log(volumes); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/audio/translations" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -F "file=@audio.wav" \ - -F "model=openai/whisper-large-v3" \ - -F "language=es" - operationId: audio-translations + curl -X POST \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "name": "my-volume" }' \ + https://api.together.ai/v1/deployments/storage/volumes requestBody: - required: true content: - multipart/form-data: + application/json: schema: - $ref: '#/components/schemas/AudioTranslationRequest' + $ref: "#/components/schemas/CreateVolumeRequest" + description: Volume configuration + required: true responses: - '200': - description: OK + "200": + description: Volume created successfully content: application/json: schema: - $ref: '#/components/schemas/AudioTranslationResponse' - '400': - description: BadRequest + $ref: "#/components/schemas/VolumeResponseItem" + "400": + description: Invalid request content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '401': - description: Unauthorized + type: object + "500": + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '429': - description: RateLimit + type: object + /deployments/storage/volumes/{id}: + delete: + description: Delete an existing volume + parameters: + - name: id + in: path + required: true + schema: + description: Volume ID or name + type: string + responses: + "200": + description: Volume deleted successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /compute/clusters: - get: + type: object + "404": + description: Volume not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + summary: Delete a volume tags: - - GPUClusterService - summary: List all GPU clusters - description: List all GPU clusters. - operationId: GPUClusterService_List + - Volumes + get: + description: Retrieve details of a specific volume by its ID or name parameters: - - name: project_id + - name: id + in: path + required: true + schema: + description: Volume ID or name + type: string + - name: version in: query schema: - description: >- - Optional UMS project ID to filter clusters by. When set, only - clusters - belonging to this project are returned. The caller must be a member of - the project; otherwise the result set will be empty. + description: Volume version to describe (defaults to current version) + type: integer + responses: + "200": + description: Volume details + content: + application/json: + schema: + $ref: "#/components/schemas/VolumeResponseItem" + "400": + description: Bad request + content: + application/json: + schema: + type: object + "404": + description: Volume not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + summary: Get a volume by ID or name + tags: + - Volumes + patch: + description: Update an existing volume's configuration or contents + parameters: + - name: id + in: path + required: true + schema: + description: Volume ID or name. type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateVolumeRequest" + description: Updated volume configuration + required: true + responses: + "200": + description: Volume updated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/VolumeResponseItem" + "400": + description: Invalid request + content: + application/json: + schema: + type: object + "404": + description: Volume not found + content: + application/json: + schema: + type: object + "500": + description: Internal server error + content: + application/json: + schema: + type: object + summary: Update a volume + tags: + - Volumes + /voices: + get: + tags: ['Voices'] + summary: Fetch available voices for each model + description: Fetch available voices for each model + operationId: fetchVoices responses: '200': - description: OK + description: Success content: application/json: schema: - $ref: '#/components/schemas/GPUClusters' + $ref: '#/components/schemas/ListVoicesResponse' x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together import os @@ -4837,9 +3890,22 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.beta.clusters.list() + response = client.audio.voices.list() - print(response.clusters) + print(response.data) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.audio.voices.list() + + print(response.data) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -4849,9 +3915,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.beta.clusters.list(); + const response = await client.audio.voices.list() - console.log(response.clusters); + console.log(response.data); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -4861,630 +3927,610 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.beta.clusters.list(); - - console.log(response.clusters); - - lang: Shell - label: CLI - source: tg beta clusters list - post: - tags: - - GPUClusterService - summary: Create a GPU cluster - description: > - Create an Instant Cluster on Together's high-performance GPU clusters. - - With features like on-demand scaling, long-lived resizable - high-bandwidth shared DC-local storage, - - Kubernetes and Slurm cluster flavors, a REST API, and Terraform support, + const response = await client.audio.voices.list() - you can run workloads flexibly without complex infrastructure - management. - operationId: GPUClusterService_Create - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GPUClusterCreateRequest' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GPUClusterInfo' + console.log(response.data); + /videos/{id}: + get: + tags: ['Video'] + summary: Fetch video metadata + description: Fetch video metadata + servers: + - url: https://api.together.ai/v2 + operationId: retrieveVideo x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together + import os - client = Together() + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - response = client.beta.clusters.create( - cluster_name="my-gpu-cluster", - region="us-central-8", - gpu_type="H100_SXM", - num_gpus=8, - nvidia_driver_version="560", - cuda_version="12.6", - billint_type="ON_DEMAND", + response = client.videos.retrieve(video_id) + + print(response.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), ) - print(response.cluster_id) + response = client.videos.retrieve(video_id) + + print(response.id) - lang: TypeScript - label: Together AI SDK (v2) + label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - const client = new Together(); - - const response = await client.beta.clusters.create({ - cluster_name: "my-gpu-cluster", - region: "us-central-8", - gpu_type: "H100_SXM", - num_gpus: 8, - nvidia_driver_version: "560", - cuda_version: "12.6", - billint_type: "ON_DEMAND", + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); - console.log(response.cluster_id) + const response = await client.videos.retrieve(videoId); + + console.log(response.status); - lang: JavaScript - label: Together AI SDK (v2) + label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - const client = new Together(); - - const response = await client.beta.clusters.create({ - cluster_name: "my-gpu-cluster", - region: "us-central-8", - gpu_type: "H100_SXM", - num_gpus: 8, - nvidia_driver_version: "560", - cuda_version: "12.6", - billint_type: "ON_DEMAND", + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); - console.log(response.cluster_id) - - lang: Shell - label: CLI - source: | - tg beta clusters create \ - --name my-gpu-cluster \ - --region us-central-8 \ - --gpu-type H100_SXM \ - --cluster-type KUBERNETES \ - --num-gpus 8 \ - --billing-type ON_DEMAND \ - --nvidia-driver-version 560 \ - --cuda-version 12.6 - /compute/clusters/{cluster_id}: - get: - tags: - - GPUClusterService - summary: Get GPU cluster by cluster ID - description: Retrieve information about a specific GPU cluster. - operationId: GPUClusterService_Get + const response = await client.videos.retrieve(videoId); + + console.log(response.status); parameters: - - name: cluster_id - in: path + - in: path + name: id required: true schema: - description: The ID of the cluster to retrieve + description: Identifier of video from create response. type: string responses: '200': - description: OK + description: Success content: application/json: schema: - $ref: '#/components/schemas/GPUClusterInfo' + $ref: '#/components/schemas/VideoJob' + '400': + description: Invalid request parameters. + '404': + description: Video ID not found. + /videos: + post: + tags: ['Video'] + summary: Create video + description: Create a video + operationId: createVideo + servers: + - url: https://api.together.ai/v2 x-codeSamples: - lang: Python label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.videos.create( + model="together/video-model", + prompt="A cartoon of an astronaut riding a horse on the moon" + ) + + print(response.id) + - lang: Python + label: Together AI SDK (v1) source: | from together import Together - client = Together() + import os - cluster = client.beta.clusters.retrieve("cluster_id") - print(cluster) + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.videos.create( + model="together/video-model", + prompt="A cartoon of an astronaut riding a horse on the moon" + ) + + print(response.id) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - const client = new Together(); - const cluster = await client.beta.clusters.retrieve("cluster_id"); - console.log(cluster); + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.create({ + model: "together/video-model", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.id); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - const client = new Together(); - const cluster = await client.beta.clusters.retrieve("cluster_id"); - console.log(cluster); - - lang: Shell - label: CLI - source: | - tg beta clusters get - put: - tags: - - GPUClusterService - summary: Update a GPU cluster - description: Update the configuration of an existing GPU cluster. - operationId: GPUClusterService_Update - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster to update - type: string + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.create({ + model: "together/video-model", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.id); requestBody: content: application/json: schema: - $ref: '#/components/schemas/GPUClusterUpdateRequest' - required: true + $ref: '#/components/schemas/CreateVideoBody' responses: '200': - description: OK + description: Success content: application/json: schema: - $ref: '#/components/schemas/GPUClusterInfo' + $ref: '#/components/schemas/VideoJob' + /chat/completions: + post: + tags: ['Chat'] + summary: Create chat completion + description: Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages. x-codeSamples: - lang: Python label: Together AI SDK (v2) - source: > + source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together + import os - client = Together() + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.chat.completions.create( + model="Qwen/Qwen3.5-9B", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What are some fun things to do in New York?"}, + ], + reasoning={"enabled": False} + ) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - cluster = client.beta.clusters.update("cluster_id", - cluster_type="KUBERNETES", num_gpus=24) + response = client.chat.completions.create( + model="Qwen/Qwen3.5-9B", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What are some fun things to do in New York?"}, + ], + reasoning={"enabled": False} + ) - print(cluster) + print(response.choices[0].message.content) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - const client = new Together(); - const cluster = await client.beta.clusters.update({ - cluster_id: "cluster_id", - cluster_type: "KUBERNETES", - num_gpus: 24, - }) - console.log(cluster) + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.chat.completions.create({ + model: "Qwen/Qwen3.5-9B", + messages: [ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", "content": "What are some fun things to do in New York?" }, + ], + reasoning: { enabled: false }, + }); + + console.log(response.choices[0].message?.content); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - const client = new Together(); - const cluster = await client.beta.clusters.update({ - cluster_id: "cluster_id", - cluster_type: "KUBERNETES", - num_gpus: 24, - }) - console.log(cluster) + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.chat.completions.create({ + model: "Qwen/Qwen3.5-9B", + messages: [ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", "content": "What are some fun things to do in New York?" }, + ], + reasoning: { enabled: false }, + }); + + console.log(response.choices[0].message?.content); - lang: Shell - label: CLI + label: cURL source: | - tg beta clusters update \ - --cluster-type KUBERNETES \ - --num-gpus 24 - delete: - tags: - - GPUClusterService - summary: Delete GPU cluster by cluster ID - description: Delete a GPU cluster by cluster ID. - operationId: GPUClusterService_Delete - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster to delete - type: string + curl -X POST "https://api.together.ai/v1/chat/completions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B", + "messages": [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What are some fun things to do in New York?"} + ], + "reasoning": {"enabled": false} + }' + operationId: chat-completions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatCompletionRequest' responses: '200': - description: OK + description: '200' content: application/json: schema: - $ref: '#/components/schemas/GPUClusterDeleteResponse' - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - cluster = client.beta.clusters.delete("cluster_id") - print(cluster) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const cluster = await client.beta.clusters.delete("cluster_id"); - console.log(cluster); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const cluster = await client.beta.clusters.delete("cluster_id"); - console.log(cluster); - - lang: Shell - label: CLI - source: | - tg beta clusters delete - /compute/regions: - get: - tags: - - RegionService - summary: List regions and corresponding supported driver versions - operationId: RegionService_List - responses: - '200': - description: OK + $ref: '#/components/schemas/ChatCompletionResponse' + text/event-stream: + schema: + $ref: '#/components/schemas/ChatCompletionStream' + '400': + description: 'BadRequest' content: application/json: schema: - $ref: '#/components/schemas/RegionListResponse' + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '503': + description: 'Overloaded' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + deprecated: false + /completions: + post: + tags: ['Completion'] + summary: Create completion + description: Generate text completions for a given prompt using a language, code, or image model. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together - client = Together() + import os - regions = client.beta.clusters.list_regions() - print(regions) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - const regions = await client.beta.clusters.list_regions(); - console.log(regions); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); + response = client.completions.create( + model="Qwen/Qwen3.5-9B", + prompt="The largest city in France is", + max_tokens=1 + ) - const regions = await client.beta.clusters.list_regions(); - console.log(regions); - - lang: Shell - label: CLI - source: | - tg beta clusters list-regions - /compute/clusters/storage/volumes: - get: - tags: - - SharedVolumeService - summary: List all shared volumes - description: List all shared volumes. - operationId: SharedVolumeService_List - parameters: - - name: project_id - in: query - schema: - description: >- - Optional UMS project ID to filter volumes by. When set, only - volumes - belonging to this project are returned. The caller must be a member of - the project; otherwise the result set will be empty. - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GPUClustersSharedVolumes' - x-codeSamples: + print(response.choices[0].text) - lang: Python - label: Together AI SDK (v2) + label: Together AI SDK (v1) source: | from together import Together - client = Together() + import os - volumes = client.beta.clusters.storage.list() - print(volumes) + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.completions.create( + model="Qwen/Qwen3.5-9B", + prompt="The largest city in France is", + max_tokens=1 + ) + + print(response.choices[0].text) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - const client = new Together(); - const volumes = await client.beta.clusters.storage.list(); - console.log(volumes); + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.completions.create({ + model: "Qwen/Qwen3.5-9B", + prompt: "The largest city in France is", + max_tokens: 1, + }); + + console.log(response.choices[0].text); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - const client = new Together(); - const volumes = await client.beta.clusters.storage.list(); - console.log(volumes); + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.completions.create({ + model: "Qwen/Qwen3.5-9B", + prompt: "The largest city in France is", + max_tokens: 1 + }); + + console.log(response.choices[0].text); - lang: Shell - label: CLI + label: cURL source: | - tg beta clusters storage list - put: - tags: - - SharedVolumeService - summary: Update a shared volume - description: | - Update the configuration of an existing shared volume. - operationId: SharedVolumeService_Update + curl -X POST "https://api.together.ai/v1/completions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B", + "prompt": "The largest city in France is", + "max_tokens": 1 + }' + operationId: completions requestBody: content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolumeUpdateRequest' - required: true + $ref: '#/components/schemas/CompletionRequest' responses: '200': - description: OK + description: '200' content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolume' + $ref: '#/components/schemas/CompletionResponse' + text/event-stream: + schema: + $ref: '#/components/schemas/CompletionStream' + '400': + description: 'BadRequest' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '503': + description: 'Overloaded' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + deprecated: false + /embeddings: + post: + tags: ['Embeddings'] + summary: Create embedding + description: Generate vector embeddings for one or more text inputs. Returns numerical arrays representing semantic meaning, useful for search, classification, and retrieval. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together - client = Together() + import os - volume = client.beta.clusters.storage.update( - volume_id="12345-67890-12345-67890", - size_tib=3 + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), ) - print(volume) + + response = client.embeddings.create( + model="BAAI/bge-large-en-v1.5", + input="New York City", + ) + + print(response.data[0].embedding) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.embeddings.create( + model="BAAI/bge-large-en-v1.5", + input="New York City", + ) + + print(response.data[0].embedding) - lang: TypeScript label: Together AI SDK (TypeScript) source: | import Together from "together-ai"; - const client = new Together(); - const volume = await client.beta.clusters.storage.update({ - volume_id: "12345-67890-12345-67890", - size_tib: 3 + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); - console.log(volume); + + const response = await client.embeddings.create({ + model: "BAAI/bge-large-en-v1.5", + input: "New York City", + }); + + console.log(response.data[0].embedding); - lang: JavaScript label: Together AI SDK (JavaScript) source: | import Together from "together-ai"; - const client = new Together(); - const volume = await client.beta.clusters.storage.update({ - volume_id: "12345-67890-12345-67890", - size_tib: 3 + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); - console.log(volume); - - lang: Shell - label: CLI - source: | - tg beta clusters storage update --size-tib 3 - post: - tags: - - SharedVolumeService - summary: Create a shared volume - description: > - Instant Clusters supports long-lived, resizable in-DC shared storage - with user data persistence. - You can dynamically create and attach volumes to your cluster at cluster - creation time, and resize as your data grows. + const response = await client.embeddings.create({ + model: "BAAI/bge-large-en-v1.5", + input: "New York City", + }); - All shared storage is backed by multi-NIC bare metal paths, ensuring - high-throughput and low-latency performance for shared storage. - operationId: SharedVolumeService_Create + console.log(response.data[0].embedding); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/embeddings" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "BAAI/bge-large-en-v1.5", + "input": "New York City" + }' + operationId: embeddings requestBody: content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolumeCreateRequest' - required: true + $ref: '#/components/schemas/EmbeddingsRequest' responses: '200': - description: OK + description: '200' content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolume' - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - volume = client.beta.clusters.storage.create( - volume_name="my-shared-volume", - size_tib=2, - region="us-west-2" - ) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const volume = await client.beta.clusters.storage.create({ - volume_name: "my-shared-volume", - size_tib: 2, - region: "us-west-2" - }); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - const client = new Together(); - - const volume = await client.beta.clusters.storage.create({ - volume_name: "my-shared-volume", - size_tib: 2, - region: "us-west-2" - }); - - lang: Shell - label: cURL - source: | - tg beta clusters storage create \ - --volume-name my-shared-volume \ - --size-tib 2 \ - --region us-west-2 - /compute/clusters/storage/volumes/{volume_id}: - get: - tags: - - SharedVolumeService - summary: Get a shared volume by ID - description: Retrieve information about a specific shared volume. - operationId: SharedVolumeService_Get - parameters: - - name: volume_id - in: path - required: true - schema: - description: The ID of the volume to retrieve - type: string - responses: - '200': - description: OK + $ref: '#/components/schemas/EmbeddingsResponse' + '400': + description: 'BadRequest' content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolume' - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - from together import Together - client = Together() - - volume = client.beta.clusters.storage.retrieve("volume_id") - print(volume) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const volume = await - client.beta.clusters.storage.retrieve("volume_id"); - - console.log(volume); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const volume = await - client.beta.clusters.storage.retrieve("volume_id"); - - console.log(volume); - - lang: Shell - label: CLI - source: | - tg beta clusters storage retrieve - delete: - tags: - - SharedVolumeService - summary: Delete a shared volume by ID - description: > - Delete a shared volume. Note that if this volume is attached to a - cluster, deleting will fail. - operationId: SharedVolumeService_Delete - parameters: - - name: volume_id - in: path - required: true - schema: - description: The ID of the volume to delete - type: string - responses: - '200': - description: OK + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' content: application/json: schema: - $ref: '#/components/schemas/GPUClustersSharedVolumeDeleteResponse' + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '503': + description: 'Overloaded' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + deprecated: false + /models: + get: + tags: ['Models'] + summary: List all models + description: Lists all of Together's open-source models and metadata including pricing, chat template, and context. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: | + # Docs for v1 can be found by changing the above selector ^ from together import Together - client = Together() - - volume = client.beta.clusters.storage.delete("volume_id") - print(volume) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: > - import Together from "together-ai"; - - const client = new Together(); - - - const volume = await - client.beta.clusters.storage.delete("volume_id"); - - console.log(volume); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: > - import Together from "together-ai"; - - const client = new Together(); + import os + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - const volume = await - client.beta.clusters.storage.delete("volume_id"); + models = client.models.list() - console.log(volume); - - lang: Shell - label: CLI - source: | - tg beta clusters storage delete - /clusters/availability-zones: - get: - tags: - - endpoints - summary: List all available availability zones - description: List all available availability zones. - operationId: availabilityZones - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/ListAvailibilityZonesResponse' - x-codeSamples: + for model in models: + print(model.id) - lang: Python - label: Together AI SDK (v2) + label: Together AI SDK (v1) source: | from together import Together import os @@ -5493,9 +4539,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.endpoints.list_avzones() + models = client.models.list() - print(response.avzones) + for model in models: + print(model.id) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -5505,9 +4552,11 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.endpoints.listAvzones(); + const models = await client.models.list(); - console.log(response.avzones); + for (const model of models) { + console.log(model.id); + } - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -5517,162 +4566,66 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.endpoints.listAvzones(); + const models = await client.models.list(); - console.log(response.avzones); + for (const model of models) { + console.log(model.id); + } - lang: Shell label: cURL source: | - curl "https://api.together.ai/v1/clusters/availability-zones" \ + curl "https://api.together.ai/v1/models" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" - /endpoints: - get: - tags: - - Endpoints - summary: List all endpoints - description: >- - Returns a list of all endpoints associated with your account. You can - filter the results by type (dedicated or serverless). - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - response = client.endpoints.list() - - for endpoint in response.data: - print(endpoint.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - endpoints = client.endpoints.list() - - for endpoint in endpoints: - print(endpoint.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const endpoints = await client.endpoints.list(); - - for (const endpoint of endpoints.data) { - console.log(endpoint); - } - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const endpoints = await client.endpoints.list(); - - for (const endpoint of endpoints.data) { - console.log(endpoint); - } - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/endpoints" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - operationId: listEndpoints + operationId: models parameters: - - name: type - in: query - required: false - schema: - description: Filter endpoints by type - type: string - enum: - - dedicated - - serverless - - name: usage_type - in: query - required: false - schema: - type: string - enum: - - on-demand - - reserved - description: Filter endpoints by usage type - - name: mine + - name: dedicated in: query - required: false schema: + description: Filter models to only return dedicated models type: boolean - description: If true, return only endpoints owned by the caller responses: '200': description: '200' content: application/json: schema: - type: object - required: - - object - - data - properties: - object: - description: The object type, which is always `list`. - const: list - data: - type: array - items: - $ref: '#/components/schemas/ListEndpoint' - example: - object: list - data: - - object: endpoint - id: endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e - name: allenai/OLMo-7B - model: allenai/OLMo-7B - type: serverless - owner: together - state: STARTED - created_at: '2024-02-28T21:34:35.444Z' - '403': - description: Unauthorized + $ref: '#/components/schemas/ModelInfoList' + '400': + description: 'BadRequest' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' content: application/json: schema: $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + deprecated: false post: - tags: - - Endpoints - summary: Create a dedicated endpoint - description: >- - Creates a new dedicated endpoint for serving models. The endpoint starts - automatically after creation. You can deploy any supported model on - hardware configurations that meet the model's requirements. + tags: ['Models'] + summary: Upload a custom model or adapter + description: Upload a custom model or adapter from Hugging Face or S3 x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -5685,16 +4638,12 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.create( - model="Qwen/Qwen3.5-9B-FP8", - hardware="1x_nvidia_a100_80gb_sxm", - autoscaling={ - "min_replicas": 2, - "max_replicas": 5, - } + response = client.models.upload( + model_name="My-Fine-Tuned-Model", + model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", ) - print(endpoint.id) + print(response.data.job_id) - lang: Python label: Together AI SDK (v1) source: | @@ -5705,14 +4654,12 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.create( - model="Qwen/Qwen3.5-9B-FP8", - hardware="1x_nvidia_a100_80gb_sxm", - min_replicas=2, - max_replicas=5, + response = client.models.upload( + "My-Fine-Tuned-Model", + "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", ) - print(endpoint.id) + print(response.job_id) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -5722,16 +4669,12 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.create({ - model: "Qwen/Qwen3.5-9B-FP8", - hardware: "1x_nvidia_a100_80gb_sxm", - autoscaling: { - max_replicas: 5, - min_replicas: 2, - } - }); + const response = await client.models.upload({ + model_name: "My-Fine-Tuned-Model", + model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", + }) - console.log(endpoint.id); + console.log(response); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -5741,64 +4684,78 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.create({ - model: "Qwen/Qwen3.5-9B-FP8", - hardware: "1x_nvidia_a100_80gb_sxm", - autoscaling: { - max_replicas: 5, - min_replicas: 2, - } - }); + const response = await client.models.upload({ + model_name: "My-Fine-Tuned-Model", + model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", + }) - console.log(endpoint.id); + console.log(response); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/endpoints" \ + curl -X POST "https://api.together.ai/v1/models" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ - "model": "Qwen/Qwen3.5-9B-FP8", - "hardware": "1x_nvidia_a100_80gb_sxm", - "autoscaling": { - "max_replicas": 5, - "min_replicas": 2 - } - }' - operationId: createEndpoint + "model_name": "My-Fine-Tuned-Model", + "model_source": "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz" + }' + operationId: uploadModel requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateEndpointRequest' + $ref: '#/components/schemas/ModelUploadRequest' responses: '200': - description: '200' + description: Model / adapter upload job created successfully content: application/json: schema: - $ref: '#/components/schemas/DedicatedEndpoint' - '403': - description: Unauthorized + $ref: '#/components/schemas/ModelUploadSuccessResponse' + + /jobs/{jobId}: + get: + tags: ['Jobs'] + summary: Get job status + description: Get the status of a specific job + operationId: getJob + parameters: + - name: jobId + in: path + required: true + schema: + example: job-a15dad11-8d8e-4007-97c5-a211304de284 + description: The ID of the job to retrieve + type: string + responses: + '200': + description: Job status retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + $ref: '#/components/schemas/JobInfoSuccessResponse' + + /jobs: + get: + tags: ['Jobs'] + summary: List all jobs + description: List all jobs and their statuses + operationId: listJobs + responses: + '200': + description: Jobs retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /endpoints/{endpointId}: - get: - tags: - - Endpoints - summary: Get endpoint by ID - description: >- - Retrieves details about a specific endpoint, including its current - state, configuration, and scaling settings. + $ref: '#/components/schemas/JobsInfoSuccessResponse' + + /images/generations: + post: + tags: ['Images'] + summary: Create image + description: Use an image model to generate an image for a given prompt. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -5811,9 +4768,13 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.retrieve("endpoint-id") + response = client.images.generate( + model="black-forest-labs/FLUX.1-schnell", + steps=4, + prompt="A cartoon of an astronaut riding a horse on the moon", + ) - print(endpoint.id) + print(response.data[0].url) - lang: Python label: Together AI SDK (v1) source: | @@ -5824,9 +4785,13 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.get("endpoint-id") + response = client.images.generate( + model="black-forest-labs/FLUX.1-schnell", + steps=4, + prompt="A cartoon of an astronaut riding a horse on the moon", + ) - print(endpoint.id) + print(response.data[0].url) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -5836,9 +4801,12 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.retrieve("endpoint-id"); + const response = await client.images.generate({ + model: "black-forest-labs/FLUX.1-schnell", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); - console.log(endpoint); + console.log(response.data[0].url); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -5848,58 +4816,124 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.retrieve("endpoint-id"); + const response = await client.images.generate({ + model: "black-forest-labs/FLUX.1-schnell", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); - console.log(endpoint); + console.log(response.data[0].url); - lang: Shell label: cURL source: | - curl "https://api.together.ai/v1/endpoints/endpoint-id" \ + curl -X POST "https://api.together.ai/v1/images/generations" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - operationId: getEndpoint - parameters: - - name: endpointId - in: path - required: true - schema: - type: string - description: The ID of the endpoint to retrieve - example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + -H "Content-Type: application/json" \ + -d '{ + "model": "black-forest-labs/FLUX.1-schnell", + "prompt": "A cartoon of an astronaut riding a horse on the moon" + }' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - prompt + - model + properties: + prompt: + type: string + description: A description of the desired images. Maximum length varies by model. + example: cat floating in space, cinematic + model: + type: string + description: > + The model to use for image generation.

[See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models) + example: black-forest-labs/FLUX.1-schnell + anyOf: + - type: string + enum: + - black-forest-labs/FLUX.1-schnell-Free + - black-forest-labs/FLUX.1-schnell + - black-forest-labs/FLUX.1.1-pro + - type: string + steps: + type: integer + default: 20 + description: Number of generation steps. + image_url: + type: string + description: URL of an image to use for image models that support it. + seed: + type: integer + description: Seed used for generation. Can be used to reproduce image generations. + n: + type: integer + default: 1 + description: Number of image results to generate. + height: + type: integer + default: 1024 + description: Height of the image to generate in number of pixels. + width: + type: integer + default: 1024 + description: Width of the image to generate in number of pixels. + negative_prompt: + type: string + description: The prompt or prompts not to guide the image generation. + response_format: + type: string + description: Format of the image response. Can be either a base64 string or a URL. + enum: + - base64 + - url + guidance_scale: + type: number + description: Adjusts the alignment of the generated image with the input prompt. Higher values (e.g., 8-10) make the output more faithful to the prompt, while lower values (e.g., 1-5) encourage more creative freedom. + default: 3.5 + output_format: + type: string + description: The format of the image response. Can be either be `jpeg` or `png`. Defaults to `jpeg`. + default: jpeg + enum: + - jpeg + - png + image_loras: + description: An array of objects that define LoRAs (Low-Rank Adaptations) to influence the generated image. + type: array + items: + type: object + required: [path, scale] + properties: + path: + type: string + description: The URL of the LoRA to apply (e.g. https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA). + scale: + type: number + description: The strength of the LoRA's influence. Most LoRA's recommend a value of 1. + reference_images: + description: An array of image URLs that guide the overall appearance and style of the generated image. These reference images influence the visual characteristics consistently across the generation. + type: array + items: + type: string + description: URL of a reference image to guide the image generation. + disable_safety_checker: + type: boolean + description: If true, disables the safety checker for image generation. responses: '200': - description: '200' - content: - application/json: - schema: - $ref: '#/components/schemas/DedicatedEndpoint' - '403': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + description: Image generated successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - patch: - tags: - - Endpoints - summary: >- - Update endpoint, this can also be used to start or stop a dedicated - endpoint - description: >- - Updates an existing endpoint's configuration. You can modify the display - name, autoscaling settings, or change the endpoint's state (start/stop). + $ref: '#/components/schemas/ImageResponse' + /files: + get: + tags: ['Files'] + summary: List all files + description: List the metadata for all uploaded data files. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -5912,12 +4946,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.update( - "endpoint-id", - state="STOPPED" - ) + response = client.files.list() - print(endpoint) + for file in response.data: + print(file.id) - lang: Python label: Together AI SDK (v1) source: | @@ -5928,12 +4960,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.update( - endpoint_id="endpoint-id", - state="STOPPED" - ) + response = client.files.list() - print(endpoint) + for file in response.data: + print(file.id) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -5943,11 +4973,11 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.update("endpoint-id", { - state: "STOPPED" - }); + const response = await client.files.list(); - console.log(endpoint); + for (const file of response.data) { + console.log(file.id); + } - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -5957,87 +4987,29 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.update("endpoint-id", { - state: "STOPPED" - }); + const response = await client.files.list(); - console.log(endpoint); + for (const file of response.data) { + console.log(file.id); + } - lang: Shell label: cURL source: | - curl -X PATCH "https://api.together.ai/v1/endpoints/endpoint-id" \ + curl "https://api.together.ai/v1/files" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "state": "STOPPED" - }' - operationId: updateEndpoint - parameters: - - name: endpointId - in: path - required: true - schema: - type: string - description: The ID of the endpoint to update - example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - display_name: - type: string - description: A human-readable name for the endpoint - example: My Llama3 70b endpoint - state: - type: string - description: The desired state of the endpoint - enum: - - STARTED - - STOPPED - example: STARTED - autoscaling: - $ref: '#/components/schemas/Autoscaling' - description: New autoscaling configuration for the endpoint - inactive_timeout: - type: integer - description: >- - The number of minutes of inactivity after which the endpoint - stops automatically. Set to 0 to disable automatic timeout. - nullable: true - example: 60 + -H "Content-Type: application/json" responses: '200': - description: '200' - content: - application/json: - schema: - $ref: '#/components/schemas/DedicatedEndpoint' - '403': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + description: List of files content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - delete: - tags: - - Endpoints - summary: Delete endpoint - description: Permanently deletes an endpoint. This action cannot be undone. + $ref: '#/components/schemas/FileList' + /files/{id}: + get: + tags: ['Files'] + summary: Retrieve file metadata + description: Retrieve the metadata for a single uploaded data file. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6050,9 +5022,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.delete("endpoint-id") + file = client.files.retrieve(id="file-id") - print(endpoint) + print(file) - lang: Python label: Together AI SDK (v1) source: | @@ -6063,11 +5035,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - endpoint = client.endpoints.delete( - endpoint_id="endpoint-id", - ) + file = client.files.retrieve(id="file-id") - print(endpoint) + print(file) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6077,9 +5047,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.delete("endpoint-id"); + const file = await client.files.retrieve("file-id"); - console.log(endpoint); + console.log(file); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6089,55 +5059,33 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const endpoint = await client.endpoints.delete("endpoint-id"); + const file = await client.files.retrieve("file-id"); - console.log(endpoint); + console.log(file); - lang: Shell label: cURL - source: > - curl -X "DELETE" "https://api.together.ai/v1/endpoints/endpoint-id" - \ - -H "Authorization: Bearer $TOGETHER_API_KEY" - operationId: deleteEndpoint + source: | + curl "https://api.together.ai/v1/files/ID" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" parameters: - - name: endpointId + - name: id in: path required: true schema: + description: The ID of the file to retrieve type: string - description: The ID of the endpoint to delete - example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 responses: - '204': - description: No Content - Endpoint successfully deleted - '403': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + '200': + description: File retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /hardware: - get: - tags: - - Hardware - summary: List available hardware configurations - description: > - Returns a list of available hardware configurations for deploying - models. When a model parameter is provided, it returns only hardware - configurations compatible with that model, including their current - availability status. + $ref: '#/components/schemas/FileResponse' + delete: + tags: ['Files'] + summary: Delete a file + description: Delete a previously uploaded data file. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6150,10 +5098,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.endpoints.list_hardware() + response = client.files.delete(id="file-id") - for hardware in response.data: - print(hardware.id) + print(response) - lang: Python label: Together AI SDK (v1) source: | @@ -6164,10 +5111,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.endpoints.list_hardware() + response = client.files.delete(id="file-id") - for hardware in response: - print(hardware.id) + print(response) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6177,9 +5123,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const hardware = await client.endpoints.list_hardware(); + const response = await client.files.delete("file-id"); - console.log(hardware); + console.log(response); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6189,76 +5135,33 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const hardware = await client.endpoints.list_hardware(); + const response = await client.files.delete("file-id"); - console.log(hardware); + console.log(response); - lang: Shell label: cURL source: | - curl "https://api.together.ai/v1/hardware" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - operationId: listHardware + curl -X "DELETE" "https://api.together.ai/v1/files/file-id" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" parameters: - - name: model - in: query - required: false + - name: id + in: path + required: true schema: + description: The ID of the file to delete type: string - description: > - Filter hardware configurations by model compatibility. When - provided, - - the response includes availability status for each compatible - configuration. - - [See all of Together AI's dedicated - models](https://docs.together.ai/docs/dedicated-models) - example: deepseek-ai/DeepSeek-R1 responses: '200': - description: List of available hardware configurations - content: - application/json: - schema: - type: object - required: - - object - - data - properties: - object: - description: The object type, which is always `list`. - const: list - data: - type: array - items: - $ref: '#/components/schemas/HardwareWithStatus' - '403': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Internal error + description: File deleted successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /tci/execute: - post: - tags: - - Code Interpreter - summary: Execute code - callbacks: {} - description: > - Executes the given code snippet and returns the output. Without a - session_id, a new session is created to run the code. If you pass a - valid session_id, the code runs in that session. This is useful for - running multiple code snippets in the same environment, because - dependencies and similar things are persisted - - between calls to the same session. + $ref: '#/components/schemas/FileDeleteResponse' + /files/{id}/content: + get: + tags: ['Files'] + summary: Get file contents + description: Get the contents of a single uploaded data file. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6271,12 +5174,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.code_interpreter.execute( - code="print('Hello world!')", - language="python", - ) - - print(response.data.outputs[0].data); + with client.files.with_streaming_response.content(id="file-id") as response: + for line in response.iter_lines(): + print(line) - lang: Python label: Together AI SDK (v1) source: | @@ -6287,12 +5187,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.code_interpreter.run( - code="print('Hello world!')", - language="python", - ) + file = client.files.retrieve_content(id="file-id") - print(response.data.outputs[0].data); + print(file.filename) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6302,12 +5199,10 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.codeInterpreter.execute({ - code: "print('Hello world!')", - language: "python" - }); + const response = await client.files.content("file-id"); + const content = await response.text(); - console.log(response.data?.outputs?.[0]?.data); + console.log(content); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6317,46 +5212,42 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.codeInterpreter.execute({ - code: "print('Hello world!')", - language: "python" - }); + const response = await client.files.content("file-id"); + const content = await response.text(); - console.log(response.data?.outputs?.[0]?.data); + console.log(content); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/tci/execute" \ + curl "https://api.together.ai/v1/files/file-id/content" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "code": "print(\'Hello world!\')", - "language": "python" - }' - operationId: tci/execute - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExecuteRequest' - description: Execute Request - required: false + -H "Content-Type: application/json" + parameters: + - name: id + in: path + required: true + schema: + description: The ID of the file to get the content of + type: string responses: '200': + description: File content retrieved successfully + content: + text/plain: + schema: + type: string + format: binary + '500': + description: Internal Server Error content: application/json: schema: - $ref: '#/components/schemas/ExecuteResponse' - description: Execute Response - /tci/sessions: - get: - summary: List active sessions - tags: - - Code Interpreter - callbacks: {} - description: | - Lists all your currently active sessions. + $ref: '#/components/schemas/ErrorData' + /files/upload: + post: + tags: ['Files'] + summary: Upload a file + description: Upload a file with specified purpose, file name, and file type. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6369,190 +5260,147 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.code_interpreter.sessions.list() + current_dir = os.path.dirname(os.path.abspath(__file__)) + file_path = os.path.join(current_dir, "data.jsonl") + file = client.files.upload(file=file_path) - for session in response.data.sessions: - print(session.id) + print(file.id) - lang: Python label: Together AI SDK (v1) source: | - # together v1 does not support this method + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + current_dir = os.path.dirname(os.path.abspath(__file__)) + file_path = os.path.join(current_dir, "data.jsonl") + file = client.files.upload(file=file_path) + + print(file.id) - lang: TypeScript label: Together AI SDK (TypeScript) source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); + import { upload } from "together-ai/lib/upload" + import path from "path"; + import { fileURLToPath } from "url"; - const response = await client.codeInterpreter.sessions.list(); + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + const filepath = path.join(__dirname, "data.jsonl"); + const file = await upload(filepath); - for (const session of response.data?.sessions) { - console.log(session.id); - } + console.log(file.id); - lang: JavaScript label: Together AI SDK (JavaScript) source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); + import { upload } from "together-ai/lib/upload" + import path from "path"; + import { fileURLToPath } from "url"; - const response = await client.codeInterpreter.sessions.list(); + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + const filepath = path.join(__dirname, "data.jsonl"); + const file = await upload(filepath); - for (const session of response.data?.sessions) { - console.log(session.id); - } + console.log(file.id); - lang: Shell label: cURL source: | - curl "https://api.together.ai/v1/tci/sessions" \ + curl "https://api.together.ai/v1/files/upload" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - operationId: sessions/list - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SessionListResponse' - description: List Response - /batches: - get: - tags: - - Batches - summary: List batch jobs - description: List all batch jobs for the authenticated user - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - batches = client.batches.list() - - for batch in batches: - print(batch.id) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - batches = client.batches.list_batches() - - for batch in batches: - print(batch.id) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const batches = await client.batches.list(); - - console.log(batches); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const batches = await client.batches.list(); - - console.log(batches); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/batches" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - security: - - bearerAuth: [] + -F "file=@/path/to/data.jsonl" \ + -F "file_name=data.jsonl" \ + -F "purpose=fine-tune" + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - purpose + - file_name + - file + properties: + purpose: + $ref: '#/components/schemas/FilePurpose' + file_name: + type: string + description: The name of the file being uploaded + example: 'dataset.csv' + file_type: + $ref: '#/components/schemas/FileType' + file: + type: string + format: binary + description: The content of the file being uploaded responses: '200': - description: OK + description: File uploaded successfully content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/BatchJob' - '401': - description: Unauthorized + $ref: '#/components/schemas/FileResponse' + '500': + description: Internal Server Error content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - '500': - description: Internal Server Error + $ref: '#/components/schemas/ErrorData' + '400': + description: Bad Request content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /fine-tunes: post: - tags: - - Batches - summary: Create a batch job - description: Create a new batch job with the given input file and endpoint + tags: ['Fine-tuning'] + summary: Create job + description: Create a fine-tuning job with the provided model and training data. x-codeSamples: - lang: Python label: Together AI SDK (v2) - source: > + source: | # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - client = Together( api_key=os.environ.get("TOGETHER_API_KEY"), ) + response = client.fine_tuning.create( + model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file="file-id" + ) - batch = client.batches.create(input_file_id="file_id", - endpoint="/v1/chat/completions") - - - print(batch.job) + print(response) - lang: Python label: Together AI SDK (v1) - source: > + source: | from together import Together - import os - client = Together( api_key=os.environ.get("TOGETHER_API_KEY"), ) + response = client.fine_tuning.create( + model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file="file-id" + ) - batch = client.batches.create_batch("file_id", - endpoint="/v1/chat/completions") - - - print(batch.id) + print(response) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6562,12 +5410,12 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const batch = await client.batches.create({ - endpoint: "/v1/chat/completions", - input_file_id: "file-id", + const response = await client.fineTuning.create({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "file-id", }); - console.log(batch); + console.log(response); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6577,223 +5425,194 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const batch = await client.batches.create({ - endpoint: "/v1/chat/completions", - input_file_id: "file-id", + const response = await client.fineTuning.create({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "file-id", }); - console.log(batch); + console.log(response); - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/batches" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "endpoint": "/v1/chat/completions", - "input_file_id": "file-id" - }' - - lang: Python - label: Audio transcriptions (Python) - source: > - # Audio transcription batches use the /v1/audio/transcriptions - endpoint. - - # Each line in the uploaded JSONL must include `"method": "FILE"` so - the - - # worker dispatches the request as multipart/form-data. Example - line: - - # {"custom_id": "transcription-1", "method": "FILE", - - # "body": {"file": "https://example.com/audio.wav", - - # "model": "openai/whisper-large-v3"}} - - from together import Together - - import os - - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - - batch = client.batches.create( - input_file_id="file_id", - endpoint="/v1/audio/transcriptions", - ) - - - print(batch.job) - - lang: Shell - label: Audio transcriptions (cURL) - source: | - curl -X POST "https://api.together.ai/v1/batches" \ + curl -X POST "https://api.together.ai/v1/fine-tunes" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ - "endpoint": "/v1/audio/transcriptions", - "input_file_id": "file-id" + "model": "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + "training_file": "file-id" }' - security: - - bearerAuth: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateBatchRequest' - responses: - '201': - description: Job created (potentially with warnings) - content: - application/json: - schema: - $ref: '#/components/schemas/BatchJobWithWarning' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '429': - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - /batches/{id}: - get: - tags: - - Batches - summary: Get a batch job - description: Get details of a batch job by ID - x-codeSamples: - - lang: Python - label: Together AI SDK (v2) - source: | - # Docs for v1 can be found by changing the above selector ^ - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - batch = client.batches.retrieve("batch_id") - - print(batch) - - lang: Python - label: Together AI SDK (v1) - source: | - from together import Together - import os - - client = Together( - api_key=os.environ.get("TOGETHER_API_KEY"), - ) - - batch = client.batches.get_batch("batch_id") - - print(batch) - - lang: TypeScript - label: Together AI SDK (TypeScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const batch = await client.batches.retrieve("batch-id"); - - console.log(batch); - - lang: JavaScript - label: Together AI SDK (JavaScript) - source: | - import Together from "together-ai"; - - const client = new Together({ - apiKey: process.env.TOGETHER_API_KEY, - }); - - const batch = await client.batches.retrieve("batch-id"); - - console.log(batch); - - lang: Shell - label: cURL - source: | - curl "https://api.together.ai/v1/batches/ID" \ - -H "Authorization: Bearer $TOGETHER_API_KEY" \ - -H "Content-Type: application/json" - security: - - bearerAuth: [] - parameters: - - name: id - in: path - required: true - schema: - type: string - description: The ID of the batch job to retrieve - example: batch_job_abc123def456 + type: object + required: + - training_file + - model + properties: + training_file: + type: string + description: File-ID of a training file uploaded to the Together API + validation_file: + type: string + description: File-ID of a validation file uploaded to the Together API + packing: + type: boolean + default: true + description: Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format. + max_seq_length: + type: integer + description: Maximum sequence length to use for training. If not specified, the maximum allowed for the model and training method will be used. + model: + type: string + description: Name of the base model to run fine-tune job on + n_epochs: + type: integer + default: 1 + description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting) + n_checkpoints: + type: integer + default: 1 + maximum: 10 + description: Number of intermediate model versions saved during training for evaluation + n_evals: + type: integer + default: 0 + description: Number of evaluations to be run on a given validation set during training + batch_size: + oneOf: + - type: integer + - type: string + enum: + - max + default: 'max' + description: Number of training examples processed together (larger batches use more memory but may train faster). Defaults to "max". We use training optimizations like packing, so the effective batch size may be different than the value you set. + gradient_accumulation_steps: + type: integer + minimum: 0 + description: Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used. + learning_rate: + type: number + default: 0.00001 + description: Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence) + lr_scheduler: + type: object + default: none + $ref: '#/components/schemas/LRScheduler' + description: The learning rate scheduler to use. It specifies how the learning rate is adjusted during training. + warmup_ratio: + type: number + default: 0.0 + description: The percent of steps at the start of training to linearly increase the learning rate. + max_grad_norm: + type: number + default: 1.0 + description: Max gradient norm to be used for gradient clipping. Set to 0 to disable. + weight_decay: + type: number + default: 0.0 + description: Weight decay. Regularization parameter for the optimizer. + random_seed: + type: integer + nullable: true + description: > + Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42). + early_stopping_enabled: + type: boolean + default: false + description: > + Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected. + early_stopping_patience: + type: integer + default: 2 + minimum: 1 + description: > + Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true. + early_stopping_min_delta: + type: number + default: 0.0 + minimum: 0 + description: > + Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true. + early_stopping_warmup_evals: + type: integer + default: 1 + minimum: 0 + nullable: true + description: > + Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true. + suffix: + type: string + maxLength: 64 + description: Suffix to add to your fine-tuned model name. Must be at most 64 characters long. + wandb_api_key: + type: string + description: Integration key for tracking experiments and model metrics on W&B platform + wandb_base_url: + type: string + description: The base URL of a dedicated Weights & Biases instance. + wandb_project_name: + type: string + description: The Weights & Biases project for your run. If not specified, uses `together` as the project name. + wandb_name: + type: string + description: The Weights & Biases name for your run. + wandb_entity: + type: string + description: The Weights & Biases entity for your run. + train_on_inputs: + oneOf: + - type: boolean + - type: string + enum: + - auto + type: boolean + default: auto + description: Whether to mask user messages in conversational data or prompts in instruction data. + deprecated: true + training_method: + type: object + oneOf: + - $ref: '#/components/schemas/TrainingMethodSFT' + - $ref: '#/components/schemas/TrainingMethodDPO' + description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization. + training_type: + type: object + default: null + nullable: true + anyOf: + - $ref: '#/components/schemas/FullTrainingType' + - $ref: '#/components/schemas/LoRATrainingType' + description: The training type to use. Defaults to LoRA if not provided. + multimodal_params: + $ref: '#/components/schemas/MultimodalParams' + from_checkpoint: + type: string + description: The checkpoint identifier to continue training from a previous fine-tuning job. Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the final checkpoint. + from_hf_model: + type: string + description: The Hugging Face Hub repo to start training from. Should be as close as possible to the base model (specified by the `model` argument) in terms of architecture and size. + hf_model_revision: + type: string + description: The revision of the Hugging Face Hub model to continue training from. E.g., hf_model_revision=main (default, used if the argument is not provided) or hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit). + hf_api_token: + type: string + description: The API token for the Hugging Face Hub. + hf_output_repo_name: + type: string + description: The name of the Hugging Face repository to upload the fine-tuned model to. responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/BatchJob' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '500': - description: Internal Server Error + description: Fine-tuning job initiated successfully content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - /batches/{id}/cancel: - post: - tags: - - Batches - summary: Cancel a batch job - description: Cancel a batch job by ID + $ref: '#/components/schemas/FinetuneResponseTruncated' + get: + tags: ['Fine-tuning'] + summary: List all jobs + description: List the metadata for all fine-tuning jobs. Returns a list of FinetuneResponseTruncated objects. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6806,9 +5625,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - batch = client.batches.cancel("batch_id") + response = client.fine_tuning.list() - print(batch) + for fine_tune in response.data: + print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") - lang: Python label: Together AI SDK (v1) source: | @@ -6819,9 +5639,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - batch = client.batches.cancel("batch_id") + response = client.fine_tuning.list() - print(batch) + for fine_tune in response.data: + print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6831,9 +5652,11 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const batch = await client.batches.cancel("batch-id"); + const response = await client.fineTuning.list(); - console.log(batch); + for (const fineTune of response.data) { + console.log(fineTune.id, fineTune.status); + } - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6843,68 +5666,193 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const batch = await client.batches.cancel("batch-id"); + const response = await client.fineTuning.list(); - console.log(batch); + for (const fineTune of response.data) { + console.log(fineTune.id, fineTune.status); + } - lang: Shell label: cURL source: | - curl -X POST "https://api.together.ai/v1/batches/ID/cancel" \ + curl "https://api.together.ai/v1/fine-tunes" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" - security: - - bearerAuth: [] - parameters: - - name: id - in: path - required: true - schema: - type: string - description: The ID of the batch job to cancel - example: batch_job_abc123def456 responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/BatchJob' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '403': - description: Forbidden + description: List of fine-tune jobs content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - '404': - description: Not Found + $ref: '#/components/schemas/FinetuneTruncatedList' + /fine-tunes/estimate-price: + post: + tags: ['Fine-tuning'] + summary: Estimate price + description: Estimate the price of a fine-tuning job. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - training_file + properties: + training_file: + type: string + description: File-ID of a training file uploaded to the Together API + validation_file: + type: string + description: File-ID of a validation file uploaded to the Together API + model: + type: string + description: Name of the base model to run fine-tune job on + n_epochs: + type: integer + default: 1 + description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting) + n_evals: + type: integer + default: 0 + description: Number of evaluations to be run on a given validation set during training + training_method: + type: object + oneOf: + - $ref: '#/components/schemas/TrainingMethodSFT' + - $ref: '#/components/schemas/TrainingMethodDPO' + description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization. + training_type: + type: object + default: null + nullable: true + oneOf: + - $ref: '#/components/schemas/FullTrainingType' + - $ref: '#/components/schemas/LoRATrainingType' + description: The training type to use. Defaults to LoRA if not provided. + from_checkpoint: + type: string + description: The checkpoint identifier to continue training from a previous fine-tuning job. Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the final checkpoint. + responses: + '500': + description: Internal Server Error content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' + '200': + description: Price estimated successfully + content: + application/json: + schema: + oneOf: + - type: object + x-stainless-variantName: AvailableEstimate + required: + - estimation_available + properties: + estimation_available: + type: boolean + enum: [true] + x-stainless-const: true + description: Whether price estimation is available for the requested fine-tune job. + estimated_total_price: + type: number + description: The price of the fine-tuning job + allowed_to_proceed: + type: boolean + description: Whether you are allowed to proceed with the fine-tuning job. + example: true + user_limit: + type: number + description: Your credit limit in dollars. + estimated_train_token_count: + type: number + description: The estimated number of tokens to be trained + estimated_eval_token_count: + type: number + description: The estimated number of tokens for evaluation + - type: object + x-stainless-variantName: UnavailableEstimate + required: + - estimation_available + - unavailable_reason + properties: + estimation_available: + type: boolean + enum: [false] + x-stainless-const: true + description: Whether price estimation is available for the requested fine-tune job. + unavailable_reason: + type: string + description: Reason price estimation is unavailable for the requested fine-tune job. + enum: + - multimodal_dataset + - train_file_not_validated + - eval_file_not_validated + - train_file_invalid + - eval_file_invalid + example: multimodal_dataset + /fine-tunes/preview: + post: + tags: ['Fine-tuning'] + summary: Preview tokenized data + description: Preview how sampled rows from a fine-tuning training file will be tokenized before packing. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FineTunePreviewRequest' + responses: + '200': + description: Tokenized data preview generated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/FineTunePreviewResponse' + '400': + description: Invalid request or unsupported dataset for preview. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/FineTunePreviewMessageError' + - $ref: '#/components/schemas/FineTunePreviewDetailError' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: Training file not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' '500': description: Internal Server Error content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - /evaluation: - post: - tags: - - evaluation - summary: Create an evaluation job - operationId: createEvaluationJob + $ref: '#/components/schemas/FineTunePreviewMessageError' + '502': + description: Preview service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/FineTunePreviewMessageError' + '503': + description: Preview service is at capacity. + content: + application/json: + schema: + $ref: '#/components/schemas/FineTunePreviewDetailError' + /fine-tunes/{id}: + get: + tags: ['Fine-tuning'] + summary: List job + description: List the metadata for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -6917,22 +5865,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evals.create( - type="classify", - parameters=ParametersEvaluationClassifyParameters( - judge=ParametersEvaluationClassifyParametersJudge( - model="openai/gpt-oss-120b", - model_source="serverless", - system_template="You are an expert evaluator...", - ), - input_data_file_path="file-abc123", - labels=["good", "bad"], - pass_labels=["good"], - model_to_evaluate="Qwen/Qwen3.5-9B" - ) - ) + fine_tune = client.fine_tuning.retrieve(id="ft-id") - print(response.workflow_id) + print(fine_tune) - lang: Python label: Together AI SDK (v1) source: | @@ -6943,17 +5878,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evaluation.create( - type="classify", - judge_model_name="openai/gpt-oss-120b", - judge_system_template="You are an expert evaluator...", - input_data_file_path="file-abc123", - labels=["good", "bad"], - pass_labels=["good"], - model_to_evaluate="Qwen/Qwen3.5-9B" - ) + fine_tune = client.fine_tuning.retrieve(id="ft-id") - print(response.workflow_id) + print(fine_tune) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -6963,22 +5890,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.create({ - type: 'classify', - parameters: { - judge: { - model: 'openai/gpt-oss-120b', - model_source: 'serverless', - system_template: 'You are an expert evaluator...', - }, - input_data_file_path: 'file-abc123', - labels: ['good', 'bad'], - pass_labels: ['good'], - model_to_evaluate: 'Qwen/Qwen3.5-9B', - }, - }); + const fineTune = await client.fineTuning.retrieve("ft-id"); - console.log(response.workflow_id); + console.log(fineTune); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -6988,52 +5902,33 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.create({ - type: 'classify', - parameters: { - judge: { - model: 'openai/gpt-oss-120b', - model_source: 'serverless', - system_template: 'You are an expert evaluator...', - }, - input_data_file_path: 'file-abc123', - labels: ['good', 'bad'], - pass_labels: ['good'], - model_to_evaluate: 'Qwen/Qwen3.5-9B', - }, - }); + const fineTune = await client.fineTuning.retrieve("ft-id"); - console.log(response.workflow_id); - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EvaluationTypedRequest' + console.log(fineTune); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/ft-id" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + parameters: + - name: id + in: path + required: true + schema: + description: The ID of the job to retrieve + type: string responses: '200': - description: Evaluation job created successfully - content: - application/json: - schema: - $ref: '#/components/schemas/EvaluationResponse' - '400': - description: Invalid request format - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Failed to create evaluation job + description: Fine-tune job details retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - get: - tags: - - evaluation - summary: Get all evaluation jobs - operationId: getAllEvaluationJobs + $ref: '#/components/schemas/FinetuneResponse' + delete: + tags: ['Fine-tuning'] + summary: Delete a fine-tune job + description: Delete a fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -7046,10 +5941,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evals.list() + response = client.fine_tuning.delete(id="ft-id") - for job in response: - print(job.workflow_id) + print(response) - lang: Python label: Together AI SDK (v1) source: | @@ -7060,10 +5954,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - jobs = client.evaluation.list() + response = client.fine_tuning.delete(id="ft-id") - for job in jobs: - print(job.workflow_id) + print(response) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -7073,11 +5966,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.list(); + const response = await client.fineTuning.delete("ft-id"); - for (const job of response) { - console.log(job.workflow_id); - } + console.log(response); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -7087,91 +5978,53 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.list(); + const response = await client.fineTuning.delete("ft-id"); - for (const job of response) { - console.log(job.workflow_id); - } + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X "DELETE" "https://api.together.ai/v1/fine-tunes/ft-id?force=false" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" parameters: - - name: status - in: query - required: false + - name: id + in: path + required: true schema: + description: The ID of the fine-tune job to delete type: string - description: Filter evaluation jobs by status - - name: limit + - name: force + deprecated: true in: query - required: false schema: - type: integer - default: 10 - description: Limit the number of results - responses: - '200': - description: evaluation jobs retrieved successfully - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EvaluationJob' - '400': - description: Invalid request format - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Error retrieving jobs from manager - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - /evaluation/model-list: - get: - tags: - - evaluation - summary: Get model list - operationId: getModelList - parameters: - - name: model_source - in: query - required: false - schema: - type: string - description: Filter models by source - default: all + description: Deprecated and unused parameter. + type: boolean + default: false responses: '200': - description: Model list retrieved successfully + description: Fine-tune job deleted successfully content: application/json: schema: - type: object - properties: - model_list: - type: array - items: - type: string - description: The name of the model - '400': - description: Invalid request format + $ref: '#/components/schemas/FinetuneDeleteResponse' + '404': + description: Fine-tune job not found content: application/json: schema: $ref: '#/components/schemas/ErrorData' '500': - description: Error retrieving model list + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /evaluation/{id}: + /fine-tunes/{id}/events: get: - tags: - - evaluation - summary: Get evaluation job details - operationId: getEvaluationJobDetails + tags: ['Fine-tuning'] + summary: List job events + description: List the events for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -7184,9 +6037,10 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evals.retrieve('eval_id') + response = client.fine_tuning.list_events(id="ft-id") - print(response) + for event in response.data: + print(event) - lang: Python label: Together AI SDK (v1) source: | @@ -7197,9 +6051,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evaluation.retrieve('eval_id') + events = client.fine_tuning.list_events(id="ft-id") - print(response) + print(events) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -7209,9 +6063,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.retrieve('eval_id'); + const events = await client.fineTuning.listEvents("ft-id"); - console.log(response); + console.log(events); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -7221,41 +6075,34 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.retrieve('eval_id'); + const events = await client.fineTuning.listEvents("ft-id"); - console.log(response); + console.log(events); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/ft-id/events" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" parameters: - name: id in: path required: true schema: - description: The ID of the evaluation job to retrieve + description: The ID of the fine-tune job to list events for type: string responses: '200': - description: Evaluation job details retrieved successfully - content: - application/json: - schema: - $ref: '#/components/schemas/EvaluationJob' - '404': - description: Evaluation job not found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Failed to get evaluation job + description: List of fine-tune events content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /evaluation/{id}/status: + $ref: '#/components/schemas/FinetuneListEvents' + /fine-tunes/{id}/checkpoints: get: - tags: - - evaluation - summary: Get evaluation job status and results - operationId: getEvaluationJobStatusAndResults + tags: ['Fine-tuning'] + summary: List checkpoints + description: List the checkpoints for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) @@ -7268,10 +6115,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evals.status('eval_id') + checkpoints = client.fine_tuning.list_checkpoints(id="ft-id") - print(response.status) - print(response.results) + print(checkpoints) - lang: Python label: Together AI SDK (v1) source: | @@ -7282,10 +6128,9 @@ paths: api_key=os.environ.get("TOGETHER_API_KEY"), ) - response = client.evaluation.status('eval_id') + checkpoints = client.fine_tuning.list_checkpoints(id="ft-id") - print(response.status) - print(response.results) + print(checkpoints) - lang: TypeScript label: Together AI SDK (TypeScript) source: | @@ -7295,10 +6140,9 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.status('eval_id'); + const checkpoints = await client.fineTuning.listCheckpoints("ft-id"); - console.log(response.status); - console.log(response.results); + console.log(checkpoints); - lang: JavaScript label: Together AI SDK (JavaScript) source: | @@ -7308,1539 +6152,9005 @@ paths: apiKey: process.env.TOGETHER_API_KEY, }); - const response = await client.evals.status('eval_id'); + const checkpoints = await client.fineTuning.listCheckpoints("ft-id"); - console.log(response.status); - console.log(response.results); + console.log(checkpoints); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/ft-id/checkpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" parameters: - name: id in: path required: true schema: - description: The ID of the evaluation job to get the status of + description: The ID of the fine-tune job to list checkpoints for type: string responses: '200': - description: Evaluation job status and results retrieved successfully - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: The status of the evaluation job - enum: - - completed - - error - - user_error - - running - - queued - - pending - results: - description: The results of the evaluation job - oneOf: - - $ref: '#/components/schemas/EvaluationClassifyResults' - - $ref: '#/components/schemas/EvaluationScoreResults' - - $ref: '#/components/schemas/EvaluationCompareResults' - '404': - description: Evaluation job not found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '500': - description: Failed to get evaluation job + description: List of fine-tune checkpoints content: application/json: schema: - $ref: '#/components/schemas/ErrorData' - /realtime: + $ref: '#/components/schemas/FinetuneListCheckpoints' + /finetune/download: get: - tags: - - Audio - summary: Real-time audio transcription via WebSocket - description: > - Establishes a WebSocket connection for real-time audio transcription. - This endpoint uses WebSocket protocol - (wss://api.together.ai/v1/realtime) for bidirectional streaming - communication. - - - **Connection Setup:** - - - Protocol: WebSocket (wss://) - - - Authentication: Pass API key as Bearer token in Authorization header - - - Parameters: Sent as query parameters (model, input_audio_format) - - - **Client Events:** - - - `input_audio_buffer.append`: Send audio chunks as base64-encoded data - ```json - { - "type": "input_audio_buffer.append", - "audio": "" - } - ``` - - `input_audio_buffer.commit`: Signal end of audio stream. When VAD is - enabled, the server automatically detects speech boundaries and emits - `completed` events. When VAD is disabled, you must send `commit` to - trigger transcription of the buffered audio. - ```json - { - "type": "input_audio_buffer.commit" - } - ``` - - `transcription_session.updated`: Update session configuration, - including Voice Activity Detection (VAD) parameters. Send this after - receiving `session.created`. Can also be sent at any time during the - session to change VAD settings. - ```json - { - "type": "transcription_session.updated", - "session": { - "turn_detection": { - "type": "server_vad", - "threshold": 0.3, - "min_silence_duration_ms": 500, - "min_speech_duration_ms": 250, - "max_speech_duration_s": 5.0, - "speech_pad_ms": 250 - } - } - } - ``` - To disable VAD entirely (manual commit mode), set `turn_detection` to `null`: - ```json - { - "type": "transcription_session.updated", - "session": { - "turn_detection": null - } - } - ``` - - **Voice Activity Detection (VAD)** - - - VAD controls how the server automatically detects speech segments in the - audio stream. When enabled (the default), the server uses Silero VAD to - identify speech regions and emits transcription events as each segment - completes. When disabled, you must manually call - `input_audio_buffer.commit` to trigger transcription. - - - VAD can be configured in two ways: - - 1. **Query parameters** at connection time: - `turn_detection=server_vad&threshold=0.3&min_silence_duration_ms=500` - - 2. **Session message** after connection: Send - `transcription_session.updated` with a `turn_detection` object (see - above) - - - To disable VAD at connection time, use `turn_detection=none` as a query - parameter. + tags: ['Fine-tuning'] + summary: Download model + description: Receive a compressed fine-tuned model or checkpoint. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - **VAD Parameters:** + # Using `with_streaming_response` gives you control to do what you want with the response. + stream = client.fine_tuning.with_streaming_response.content(ft_id="ft-id") + with stream as response: + for line in response.iter_lines(): + print(line) - All parameters are optional. Omitted fields use their defaults. + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - | Parameter | Type | Default | Description | + # This will download the content to a location on disk + response = client.fine_tuning.download(id="ft-id") - |-----------|------|---------|-------------| + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; - | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, - or set `turn_detection` to `null` to disable. | + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); - | `threshold` | float | `0.3` | Speech probability threshold (0.0–1.0). - Audio frames with probability above this value are classified as speech. - Lower values detect more speech but may increase false positives. For - low-SNR audio (e.g., 8kHz phone calls), values of 0.01–0.2 may work - better. | + const response = await client.fineTuning.content({ + ft_id: "ft-id", + }); - | `min_silence_duration_ms` | int | `500` | Minimum silence duration in - milliseconds before ending a speech segment. Higher values merge nearby - speech bursts into single segments. For phone calls with mid-sentence - pauses, 2000–5000ms prevents over-segmentation. | + console.log(await response.blob()); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; - | `min_speech_duration_ms` | int | `250` | Minimum speech segment - duration in milliseconds. Segments shorter than this are discarded. - Filters out brief noise bursts or clicks. | + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); - | `max_speech_duration_s` | float | `5.0` | Maximum speech segment - duration in seconds. Segments longer than this are force-split at the - longest internal silence gap. Useful for continuous speech without - natural pauses. | + const response = await client.fineTuning.content({ + ft_id: "ft-id", + }); - | `speech_pad_ms` | int | `250` | Padding in milliseconds added to the - start and end of each detected segment. Prevents clipping speech edges. - When padding would cause adjacent segments to overlap, the gap is split - at the midpoint instead. | - - - **Server Events:** - - - `session.created`: Initial session confirmation (sent first) - ```json - { - "type": "session.created", - "session": { - "id": "session-id", - "object": "realtime.session", - "modalities": ["audio"], - "model": "openai/whisper-large-v3" - } - } - ``` - - `transcription_session.updated`: Confirms session configuration was - applied. Sent in response to a client `transcription_session.updated` - message. - ```json - { - "type": "transcription_session.updated", - "session": { - "turn_detection": { - "type": "server_vad", - "threshold": 0.3, - "min_silence_duration_ms": 500, - "min_speech_duration_ms": 250, - "max_speech_duration_s": 5.0, - "speech_pad_ms": 250 - } - } - } - ``` - - `conversation.item.input_audio_transcription.delta`: Partial - transcription results - ```json - { - "type": "conversation.item.input_audio_transcription.delta", - "delta": "The quick brown" - } - ``` - - `conversation.item.input_audio_transcription.completed`: Final - transcription - ```json - { - "type": "conversation.item.input_audio_transcription.completed", - "transcript": "The quick brown fox jumps over the lazy dog" - } - ``` - - `conversation.item.input_audio_transcription.failed`: Error occurred - ```json - { - "type": "conversation.item.input_audio_transcription.failed", - "error": { - "message": "Error description", - "type": "invalid_request_error", - "param": null, - "code": "invalid_api_key" - } - } - ``` - - **Error Codes:** - - - `invalid_api_key`: Invalid API key provided (401) - - - `missing_api_key`: Authorization header missing (401) - - - `model_not_available`: Invalid or unavailable model (400) - - - Unsupported audio format errors (400) - operationId: realtime-transcription + console.log(await response.blob()); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/finetune/download?ft_id=ft-id&checkpoint=merged" + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + parameters: + - in: query + name: ft_id + required: true + schema: + description: Fine-tune ID to download. A string that starts with `ft-`. + type: string + - in: query + name: checkpoint_step + required: false + schema: + description: Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set. + type: integer + - in: query + name: checkpoint + schema: + description: Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. + type: string + enum: + - merged + - adapter + - model_output_path + responses: + '200': + description: Successfully downloaded the fine-tuned model or checkpoint. + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + description: Invalid request parameters. + '404': + description: Fine-tune ID not found. + /fine-tunes/{id}/cancel: + post: + tags: ['Fine-tuning'] + summary: Cancel job + description: Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object. x-codeSamples: - lang: Python - label: Python WebSocket Client + label: Together AI SDK (v2) source: | - import asyncio - import websockets - import json - import base64 + # Docs for v1 can be found by changing the above selector ^ + from together import Together import os - async def transcribe_audio(): - api_key = os.environ.get("TOGETHER_API_KEY") - url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000" - - headers = { - "Authorization": f"Bearer {api_key}" - } - - async with websockets.connect(url, additional_headers=headers) as ws: - # Read audio file - with open("audio.wav", "rb") as f: - audio_data = f.read() - - # Send audio in chunks with delay to simulate real-time - chunk_size = 8192 - bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit) - delay_per_chunk = chunk_size / bytes_per_second - - for i in range(0, len(audio_data), chunk_size): - chunk = audio_data[i:i+chunk_size] - base64_chunk = base64.b64encode(chunk).decode('utf-8') - await ws.send(json.dumps({ - "type": "input_audio_buffer.append", - "audio": base64_chunk - })) - # Simulate real-time streaming - if i + chunk_size < len(audio_data): - await asyncio.sleep(delay_per_chunk) - - # Commit the audio buffer - await ws.send(json.dumps({ - "type": "input_audio_buffer.commit" - })) - - # Receive transcription results - async for message in ws: - data = json.loads(message) - if data["type"] == "conversation.item.input_audio_transcription.delta": - print(f"Partial: {data['delta']}") - elif data["type"] == "conversation.item.input_audio_transcription.completed": - print(f"Final: {data['transcript']}") - break - elif data["type"] == "conversation.item.input_audio_transcription.failed": - error = data.get("error", {}) - print(f"Error: {error.get('message')}") - break - - asyncio.run(transcribe_audio()) - - lang: JavaScript - label: Node.js WebSocket Client - source: > - import WebSocket from 'ws'; - - import fs from 'fs'; - - - const apiKey = process.env.TOGETHER_API_KEY; - - const url = - 'wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000'; - - - const ws = new WebSocket(url, { - headers: { - 'Authorization': `Bearer ${apiKey}` - } - }); - + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - ws.on('open', async () => { - console.log('WebSocket connection established!'); + response = client.fine_tuning.cancel(id="ft-id") - // Read audio file - const audioData = fs.readFileSync('audio.wav'); + print(response) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os - // Send audio in chunks with delay to simulate real-time - const chunkSize = 8192; - const bytesPerSecond = 16000 * 2; // 16kHz * 2 bytes (16-bit) - const delayPerChunk = (chunkSize / bytesPerSecond) * 1000; // Convert to ms + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - for (let i = 0; i < audioData.length; i += chunkSize) { - const chunk = audioData.slice(i, i + chunkSize); - const base64Chunk = chunk.toString('base64'); - ws.send(JSON.stringify({ - type: 'input_audio_buffer.append', - audio: base64Chunk - })); + response = client.fine_tuning.cancel(id="ft-id") - // Simulate real-time streaming - if (i + chunkSize < audioData.length) { - await new Promise(resolve => setTimeout(resolve, delayPerChunk)); - } - } + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; - // Commit audio buffer - ws.send(JSON.stringify({ - type: 'input_audio_buffer.commit' - })); + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); + const response = await client.fineTuning.cancel("ft-id"); - ws.on('message', (data) => { - const message = JSON.parse(data.toString()); + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; - if (message.type === 'conversation.item.input_audio_transcription.delta') { - console.log(`Partial: ${message.delta}`); - } else if (message.type === 'conversation.item.input_audio_transcription.completed') { - console.log(`Final: ${message.transcript}`); - ws.close(); - } else if (message.type === 'conversation.item.input_audio_transcription.failed') { - const errorMessage = message.error?.message ?? message.message ?? 'Unknown error'; - console.error(`Error: ${errorMessage}`); - ws.close(); - } + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, }); + const response = await client.fineTuning.cancel("ft-id"); - ws.on('error', (error) => { - console.error('WebSocket error:', error); - }); + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/fine-tunes/ft-id/cancel" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" parameters: - - in: query - name: model - required: true - schema: - type: string - description: The Whisper model to use for transcription - - in: query - name: input_audio_format + - name: id + in: path required: true schema: + description: Fine-tune ID to cancel. A string that starts with `ft-`. type: string - enum: - - pcm_s16le_16000 - default: pcm_s16le_16000 - description: >- - Audio format specification. Currently supports 16-bit PCM at 16kHz - sample rate. - responses: - '101': - description: | - Switching Protocols - WebSocket connection established successfully. - - Error message format: - ```json - { - "type": "conversation.item.input_audio_transcription.failed", - "error": { - "message": "Error description", - "type": "invalid_request_error", - "param": null, - "code": "error_code" - } - } - ``` - /queue/cancel: - post: - description: | - Cancel a pending job. Only jobs in pending status can be canceled. - Running jobs cannot be stopped. Returns the job status after the - attempt. If the job is not pending, returns 409 with the current status - unchanged. - operationId: cancelQueueJob - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueueCancelRequest' - description: Cancel request - required: true responses: '200': - description: Successfully canceled + description: Successfully cancelled the fine-tuning job. content: application/json: schema: - $ref: '#/components/schemas/QueueCancelResponse' + $ref: '#/components/schemas/FinetuneResponseTruncated' '400': - description: Invalid request - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' + description: Invalid request parameters. '404': - description: Request not found - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - '409': - description: Job could not be canceled (already completed/failed) - content: - application/json: - schema: - $ref: '#/components/schemas/QueueCancelResponse' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - summary: Cancel a queued job - tags: - - Queue - /queue/metrics: + description: Fine-tune ID not found. + /fine-tunes/{id}/metrics: get: - description: >- - Get the current queue statistics for a model, including pending and - running job counts. - operationId: getQueueMetrics + tags: ['Fine-tuning'] + summary: Get metrics + description: > + Retrieves recorded training metrics for a fine-tuning job in chronological order. All query parameters are optional: omit them to retrieve all metrics. + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl -X GET "https://api.together.ai/v1/fine-tunes/ft-id/metrics?global_step_from=0&global_step_to=500" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" parameters: - - name: model - in: query + - name: id + in: path required: true schema: - description: Model name to get metrics for + description: Fine-tune job ID. A string that starts with `ft-`. type: string - responses: - '200': - description: Queue metrics - content: - application/json: - schema: - $ref: '#/components/schemas/QueueMetricsResponse' - '400': - description: Invalid request - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - summary: Get queue metrics - tags: - - Queue - /queue/status: - get: - description: >- - Poll the current status of a previously submitted job. Provide the - request_id and model as query parameters. - operationId: getQueueJobStatus - parameters: - - name: request_id + - name: global_step_from in: query - required: true + required: false + schema: + type: integer + + description: Return only metrics with global_step >= this value. + example: 0 + - name: global_step_to + in: query + required: false + schema: + type: integer + + description: Return only metrics with global_step <= this value. + example: 500 + - name: logged_at_from + in: query + required: false schema: - description: Request ID returned from the submit endpoint type: string - - name: model + format: date-time + description: Return only metrics logged at or after this ISO-8601 timestamp. + example: "2024-01-01T00:00:00Z" + - name: logged_at_to in: query - required: true + required: false schema: - description: Model name the job was submitted to type: string + format: date-time + description: Return only metrics logged at or before this ISO-8601 timestamp. + example: "2024-01-01T12:00:00Z" + - name: resolution + in: query + required: false + schema: + type: integer + + description: Number of (uniformly sampled) train metrics to return. + example: 100 responses: '200': - description: Status information + description: List of metrics snapshots in chronological order. content: application/json: schema: - $ref: '#/components/schemas/QueueJobStatusResponse' + type: object + properties: + metrics: + type: array + items: + type: object + additionalProperties: + type: number + description: A flat dictionary of scalar metric values. + example: + metrics: + - train/loss: 0.5 + train/learning_rate: 0.0001 + train/global_step: 7 + - train/loss: 0.45 + train/learning_rate: 0.00009 + train/global_step: 14 '400': - description: Invalid request - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' + description: 'Invalid request: bad JSON body or missing job ID.' '404': - description: Request not found - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' + description: Fine-tune job not found. '500': - description: Internal server error + description: 'Internal server error: failed to retrieve metrics.' + /fine-tunes/models/supported: + get: + tags: ['Fine-tuning'] + summary: List supported models + description: List models supported for fine-tuning. + x-codeSamples: + - lang: Shell + label: cURL (list all) + source: | + curl "https://api.together.ai/v1/fine-tunes/models/supported" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + responses: + '200': + description: List of supported models. content: application/json: schema: - $ref: '#/components/schemas/QueueError' - summary: Get job status - tags: - - Queue - /queue/submit: - post: - description: | - Submit a new job to the queue for asynchronous processing. Jobs are - processed in strict priority order (higher priority first, FIFO within - the same priority). Returns a request ID that can be used to poll status - or cancel the job. - operationId: submitQueueJob - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueueJobRequest' - description: Job request - required: true + type: object + required: + - models + - detailed_models + properties: + models: + type: array + items: + type: string + description: List of supported model names. + detailed_models: + type: array + items: + type: object + required: + - name + - parent_model + properties: + name: + type: string + description: Supported model name. + parent_model: + type: string + description: Parent model used for fine-tuning. + description: Supported models with parent model details. + /fine-tunes/models/limits: + get: + tags: ['Fine-tuning'] + summary: Get model limits + description: Get model limits for a specific fine-tuning model. + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/models/limits?model_name=meta-llama/Meta-Llama-3.1-8B-Instruct-Reference" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + parameters: + - in: query + name: model_name + schema: + type: string + description: The model name to get limits for. + required: true responses: '200': - description: Successfully queued request + description: Model limits. content: application/json: schema: - $ref: '#/components/schemas/QueueJobResponse' - '400': - description: Invalid request + $ref: '#/components/schemas/FineTuneModelLimits' + '404': + description: Model not found or not supported for fine-tuning. content: application/json: schema: - $ref: '#/components/schemas/QueueError' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/QueueError' - summary: Submit a queued job - tags: - - Queue - /rl/training-sessions: - get: - summary: List training sessions - description: Lists all training sessions. - operationId: listTrainingSessions - tags: - - RL + type: object + properties: + message: + type: string + description: Error message explaining the model is not available. + /rerank: + post: + tags: ['Rerank'] + summary: Create a rerank request + description: Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + documents = [ + { + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + } + ] + + response = client.rerank.create( + model="Salesforce/Llama-Rank-v1", + query="What animals can I find near Peru?", + documents=documents, + ) + + for result in response.results: + print(f"Rank: {result.index + 1}") + print(f"Title: {documents[result.index]['title']}") + print(f"Text: {documents[result.index]['text']}") + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + documents = [ + { + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + } + ] + + response = client.rerank.create( + model="Salesforce/Llama-Rank-v1", + query="What animals can I find near Peru?", + documents=documents, + ) + + for result in response.results: + print(f"Rank: {result.index + 1}") + print(f"Title: {documents[result.index]['title']}") + print(f"Text: {documents[result.index]['text']}") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const documents = [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }]; + + const response = await client.rerank.create({ + model: "Salesforce/Llama-Rank-v1", + query: "What animals can I find near Peru?", + documents, + }); + + for (const result of response.results) { + console.log(`Rank: ${result.index + 1}`); + console.log(`Title: ${documents[result.index].title}`); + console.log(`Text: ${documents[result.index].text}`); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const documents = [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }]; + + const response = await client.rerank.create({ + model: "Salesforce/Llama-Rank-v1", + query: "What animals can I find near Peru?", + documents, + }); + + for (const result of response.results) { + console.log(`Rank: ${result.index + 1}`); + console.log(`Title: ${documents[result.index].title}`); + console.log(`Text: ${documents[result.index].text}`); + } + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/rerank" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Salesforce/Llama-Rank-v1", + "query": "What animals can I find near Peru?", + "documents": [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }] + }' + operationId: rerank + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RerankRequest' responses: '200': - description: List of training sessions + description: '200' content: application/json: schema: - $ref: '#/components/schemas/RL.TrainingSessionsListResponse' - default: - description: An unexpected error response. + $ref: '#/components/schemas/RerankResponse' + '400': + description: 'BadRequest' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - parameters: - - name: status - in: query - required: false - schema: - description: Status of the training sessions to list - $ref: '#/components/schemas/RL.TrainingSessionStatus' - - name: limit - in: query - required: false - schema: - description: Maximum number of sessions to return (1-100) - type: integer - format: int32 - default: '20' - - name: after - in: query - required: false - schema: - description: >- - Cursor for pagination (ID of the last session from the previous - page) - type: string - post: - summary: Create training session - description: Creates a training session and returns its details. - operationId: startTrainingSession - tags: - - RL - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RL.StartTrainingSessionRequest' - required: true - responses: - '200': - description: Training session details + '401': + description: 'Unauthorized' content: application/json: schema: - $ref: '#/components/schemas/RL.TrainingSession' - default: - description: An unexpected error response. + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - /rl/training-sessions/{session_id}: - get: - summary: Get training session - description: Gets a training session by its ID and returns its details. - operationId: getTrainingSession - tags: - - RL - responses: - '200': - description: Training session details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.TrainingSession' - default: - description: An unexpected error response. + '429': + description: 'RateLimit' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: ID of the training session - type: string - /rl/training-sessions/{session_id}/stop: - post: - summary: Stop training session - description: Stops a training session. - operationId: stopTrainingSession - tags: - - RL - responses: - '200': - description: Training session details + '503': + description: 'Overloaded' content: application/json: schema: - $ref: '#/components/schemas/RL.TrainingSession' - default: - description: An unexpected error response. + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: ID of the training session - type: string - /rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}: - get: - summary: Get forward-backward operation - description: Retrieves the current status and result of a forward-backward operation. - operationId: getForwardBackwardOperation - tags: - - RL + deprecated: false + /audio/speech: + post: + tags: ['Audio'] + summary: Create audio generation request + description: Generate audio from input text + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.audio.speech.with_streaming_response.create( + model="cartesia/sonic-2", + input="The quick brown fox jumps over the lazy dog.", + voice="laidback woman", + ) + + with response as stream: + stream.stream_to_file("audio.wav") + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.audio.speech.create( + model="cartesia/sonic-2", + input="The quick brown fox jumps over the lazy dog.", + voice="laidback woman", + ) + + response.stream_to_file("audio.wav") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { createWriteStream } from "fs"; + import { join } from "path"; + import { pipeline } from "stream/promises"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.speech.create({ + model: "cartesia/sonic-2", + input: "The quick brown fox jumps over the lazy dog.", + voice: "laidback woman", + }); + + const filepath = join(process.cwd(), "audio.wav"); + const writeStream = createWriteStream(filepath); + + if (response.body) { + await pipeline(response.body, writeStream); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { createWriteStream } from "fs"; + import { join } from "path"; + import { pipeline } from "stream/promises"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.speech.create({ + model: "cartesia/sonic-2", + input: "The quick brown fox jumps over the lazy dog.", + voice: "laidback woman", + }); + + const filepath = join(process.cwd(), "audio.wav"); + const writeStream = createWriteStream(filepath); + + if (response.body) { + await pipeline(response.body, writeStream); + } + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/speech" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "cartesia/sonic-2", + "input": "The quick brown fox jumps over the lazy dog.", + "voice": "laidback woman" + }' \ + --output audio.wav + operationId: audio-speech + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AudioSpeechRequest' responses: '200': - description: Forward-backward operation details + description: 'OK' content: - application/json: + application/octet-stream: schema: - $ref: '#/components/schemas/RL.ForwardBackwardOperation' - default: - description: An unexpected error response. - content: - application/json: + type: string + format: binary + audio/wav: schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - - name: operation_id - in: path - required: true - schema: - description: Operation ID - type: string - /rl/training-sessions/{session_id}/operations/optim-step/{operation_id}: - get: - summary: Get optim-step operation - description: Retrieves the current status and result of an optim-step operation. - operationId: getOptimStepOperation - tags: - - RL - responses: - '200': - description: '' - content: - application/json: + type: string + format: binary + audio/mpeg: schema: - $ref: '#/components/schemas/RL.OptimStepOperation' - default: - description: An unexpected error response. - content: - application/json: + type: string + format: binary + text/event-stream: schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - - name: operation_id - in: path - required: true - schema: - description: Operation ID - type: string - /rl/training-sessions/{session_id}/operations/sample/{operation_id}: - get: - summary: Get sample operation - description: Retrieves the current status and result of a sample operation. - operationId: GetSample - tags: - - RL - responses: - '200': - description: '' + $ref: '#/components/schemas/AudioSpeechStreamResponse' + '400': + description: 'BadRequest' content: application/json: schema: - $ref: '#/components/schemas/RL.SampleOperation' - default: - description: An unexpected error response. + $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' content: application/json: schema: $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - - name: operation_id - in: path - required: true - schema: - description: Operation ID - type: string - /rl/training-sessions/{session_id}/operations/forward-backward: - post: - summary: Forward-backward pass - description: >- - Submits a forward-backward pass operation that will asynchronously - compute gradients via backpropagation. - operationId: forwardBackward - tags: - - RL - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RL.ForwardBackwardBody' - required: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/RL.ForwardBackwardOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - /rl/training-sessions/{session_id}/operations/optim-step: - post: - summary: Optimizer step - description: >- - Submits an optimizer step operation that will asynchronously apply - accumulated gradients to update model parameters. - operationId: OptimStep - tags: - - RL - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RL.OptimStepBody' - required: true - responses: - '200': - description: Optimizer step operation details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.OptimStepOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - /rl/training-sessions/{session_id}/operations/sample: - post: - summary: Sample - description: >- - Submits a sample operation that will asynchronously generate text - completions with logprobs. - operationId: Sample - tags: - - RL - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RL.SampleBody' - required: true - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/RL.SampleOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - /rl/training-sessions/{session_id}/operations/inference-checkpoint: - post: - summary: Create inference checkpoint - description: >- - Submits an operation that will asynchronously save the current LoRA - adapter as an inference checkpoint and upload it to object storage. - operationId: createInferenceCheckpoint - tags: - - RL - responses: - '200': - description: Inference checkpoint operation details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.InferenceCheckpointOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - /rl/training-sessions/{session_id}/operations/inference-checkpoint/{operation_id}: - get: - summary: Get inference checkpoint operation - description: >- - Retrieves the current status and result of an inference checkpoint - operation. - operationId: getInferenceCheckpointOperation - tags: - - RL - responses: - '200': - description: Inference checkpoint operation details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.InferenceCheckpointOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - - name: operation_id - in: path - required: true - schema: - description: Operation ID - type: string - /rl/training-sessions/{session_id}/operations/training-checkpoint: - post: - summary: Save training checkpoint - description: >- - Submits an operation that will asynchronously save the full training - state (adapter + optimizer + step). - operationId: createTrainingCheckpoint - tags: - - RL - responses: - '200': - description: Save training checkpoint operation details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.TrainingCheckpointOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - /rl/training-sessions/{session_id}/operations/training-checkpoint/{operation_id}: - get: - summary: Get save training checkpoint operation - description: >- - Retrieves the current status and result of a save training checkpoint - operation. - operationId: getTrainingCheckpointOperation - tags: - - RL - responses: - '200': - description: Save training checkpoint operation details - content: - application/json: - schema: - $ref: '#/components/schemas/RL.TrainingCheckpointOperation' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: session_id - in: path - required: true - schema: - description: Training session ID - type: string - - name: operation_id - in: path - required: true - schema: - description: Operation ID - type: string - /rl/checkpoints/{id}/download: - get: - summary: Download checkpoint - description: >- - Returns presigned URLs for downloading a checkpoint's model files. Only - inference checkpoints support downloading. - operationId: downloadCheckpoint - tags: - - RL - responses: - '200': - description: Checkpoint download URLs - content: - application/json: - schema: - $ref: '#/components/schemas/RL.CheckpointDownloadResponse' - default: - description: An unexpected error response. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - parameters: - - name: id - in: path - required: true - schema: - description: ID of the checkpoint - type: string - - name: variant - in: query - required: true - schema: - description: >- - Checkpoint variant to download: merged (full model) or adapter - (LoRA weights only) - $ref: '#/components/schemas/RL.CheckpointVariant' - /compute/clusters/{cluster_id}/addons: + /audio/speech/websocket: get: - tags: - - InstanceClusterAddOnService - operationId: InstanceClusterAddOnService_List - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster whose add-ons to list. - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ClusterAddOnsListResponse' - post: - tags: - - InstanceClusterAddOnService - operationId: InstanceClusterAddOnService_Create - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster to create the add-on on. - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ClusterAddOnCreateRequest' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AddOnInfo' - /compute/clusters/{cluster_id}/addons/{addon_id}: - get: - tags: - - InstanceClusterAddOnService - operationId: InstanceClusterAddOnService_Get - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster that owns the add-on. - type: string - - name: addon_id - in: path - required: true - schema: - description: The ID of the add-on to retrieve. - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AddOnInfo' - put: - tags: - - InstanceClusterAddOnService - operationId: InstanceClusterAddOnService_Update - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster that owns the add-on. - type: string - - name: addon_id - in: path - required: true - schema: - description: The ID of the add-on to update. - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ClusterAddOnUpdateRequest' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AddOnInfo' - delete: - tags: - - InstanceClusterAddOnService - operationId: InstanceClusterAddOnService_Delete - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The ID of the cluster that owns the add-on. - type: string - - name: addon_id - in: path - required: true - schema: - description: The ID of the add-on to delete. - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ClusterAddOnDeleteResponse' - /compute/clusters/{cluster_id}/instances/{instance_id}/remediations: - get: - tags: - - RemediationService + tags: ['Audio'] + summary: Real-time text-to-speech via WebSocket description: | - Lists remediations for an instance or cluster. - operationId: RemediationService_ListRemediations - parameters: - - name: cluster_id - in: path - required: true - schema: - type: string - - name: instance_id - in: path - required: true - schema: - description: > - To list remediations on a specific node, pass the node's instance - ID. - - To list remediations for all nodes in a cluster, pass `-` as a - wildcard for the instance ID. - type: string - - name: page_size - in: query - schema: - description: Maximum results to return. - type: integer - - name: page_token - in: query - schema: - description: Pagination token from previous request. - type: string - - name: state - in: query - schema: - description: >- - Filter by state(s). Returns remediations matching any of the - specified states. + Establishes a WebSocket connection for real-time text-to-speech generation. This endpoint uses WebSocket protocol (wss://api.together.ai/v1/audio/speech/websocket) for bidirectional streaming communication. + **Connection Setup:** + - Protocol: WebSocket (wss://) + - Authentication: Pass API key as Bearer token in Authorization header + - Parameters: Sent as query parameters (model, voice, max_partial_length, language) - - `PENDING_APPROVAL`: Awaiting approval before processing can - begin. - - - `PENDING`: Approved and queued for processing. + **Client Events:** + - `tts_session.updated`: Update session parameters like voice. The `session` object also accepts an `extra_params` field for additional model-specific parameters that fine-tune speech generation behavior, such as `pronunciation_dict` (a list of pronunciation rules for specific characters or symbols, where each entry uses the format `"/"` (e.g., `["omg/oh my god"]`) to override how the model pronounces matching tokens). + ```json + { + "type": "tts_session.updated", + "session": { + "voice": "tara", + "extra_params": { + "pronunciation_dict": ["omg/oh my god"] + } + } + } + ``` + - `input_text_buffer.append`: Send text chunks for TTS generation + ```json + { + "type": "input_text_buffer.append", + "text": "Hello, this is a test." + } + ``` + - `input_text_buffer.clear`: Clear the buffered text + ```json + { + "type": "input_text_buffer.clear" + } + ``` + - `input_text_buffer.commit`: Signal end of text input and process remaining text + ```json + { + "type": "input_text_buffer.commit" + } + ``` - - `RUNNING`: Actively being processed. + **Server Events:** + - `session.created`: Initial session confirmation (sent first) + ```json + { + "event_id": "evt_123456", + "type": "session.created", + "session": { + "id": "session-id", + "object": "realtime.tts.session", + "modalities": ["text", "audio"], + "model": "hexgrad/Kokoro-82M", + "voice": "tara" + } + } + ``` + - `conversation.item.input_text.received`: Acknowledgment that text was received + ```json + { + "type": "conversation.item.input_text.received", + "text": "Hello, this is a test." + } + ``` + - `conversation.item.audio_output.delta`: Audio chunks as base64-encoded data + ```json + { + "type": "conversation.item.audio_output.delta", + "item_id": "tts_1", + "delta": "" + } + ``` + - `conversation.item.audio_output.done`: Audio generation complete for an item + ```json + { + "type": "conversation.item.audio_output.done", + "item_id": "tts_1" + } + ``` + - `conversation.item.tts.failed`: Error occurred + ```json + { + "type": "conversation.item.tts.failed", + "error": { + "message": "Error description", + "type": "invalid_request_error", + "param": null, + "code": "invalid_api_key" + } + } + ``` - - `SUCCEEDED`: Successfully completed. + **Text Processing:** + - Partial text (no sentence ending) is held in buffer until: + - We believe that the text is complete enough to be processed for TTS generation + - The partial text exceeds `max_partial_length` characters (default: 250) + - The `input_text_buffer.commit` event is received - - `FAILED`: Failed with an error. + **Audio Format:** + - Format: Raw PCM (s16le, mono) + - Sample Rate: 24000 Hz + - Encoding: Base64 (per delta event) + - Delivered via `conversation.item.audio_output.delta` events - - `CANCELLED`: Cancelled by user or system. + **Error Codes:** + - `invalid_api_key`: Invalid API key provided (401) + - `missing_api_key`: Authorization header missing (401) + - `model_not_available`: Invalid or unavailable model (400) + - Invalid text format errors (400) - - `AUTO_RESOLVED`: The underlying issue was automatically resolved - before processing. - type: array - items: - enum: - - PENDING_APPROVAL - - PENDING - - RUNNING - - SUCCEEDED - - FAILED - - CANCELLED - - AUTO_RESOLVED - type: string - - name: order_by - in: query - schema: - description: Order by expression. - type: string - - name: mode - in: query - schema: - description: >- - Filter by remediation mode. Returns only remediations matching the - specified mode. - enum: - - REMEDIATION_MODE_VM_ONLY - - REMEDIATION_MODE_HOST_AWARE - - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT - - REMEDIATION_MODE_REBOOT_VM - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListRemediationsResponse' + operationId: realtime-tts x-codeSamples: - lang: Python - label: Together AI SDK (v2) + label: Python WebSocket Client source: | - import together - client = together.Together(api_key="your_api_key") - remediations = client.beta.clusters.remediations.list( - cluster_id="cluster_id", - instance_id="-", - ) + import asyncio + import websockets + import json + import base64 + import os - for remediation in remediations: - print(remediation) - post: - tags: - - RemediationService - description: >- - Creates a new remediation for an instance. + async def generate_speech(): + api_key = os.environ.get("TOGETHER_API_KEY") + url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart" + headers = { + "Authorization": f"Bearer {api_key}" + } - Remediations created via the API goes directly to PENDING state. + async with websockets.connect(url, additional_headers=headers) as ws: + # Wait for session created + session_msg = await ws.recv() + session_data = json.loads(session_msg) + if session_data.get("type") != "session.created": + print(f"Failed to start session: {session_data}") + return + print(f"Session created: {session_data['session']['id']}") + + # Send text for TTS + text_chunks = [ + "Hello, this is a test.", + "This is the second sentence.", + "And this is the final one." + ] + + async def send_text(): + for chunk in text_chunks: + await ws.send(json.dumps({ + "type": "input_text_buffer.append", + "text": chunk + })) + await asyncio.sleep(0.5) # Simulate typing + # Commit to process any remaining text + await ws.send(json.dumps({ + "type": "input_text_buffer.commit" + })) - Our system may trigger automated remediations that require approval. - These remediations are created with PENDING_APPROVAL state. + async def receive_audio(): + audio_data = bytearray() + async for message in ws: + data = json.loads(message) - The user must call /approve to start the actual remediation process. + if data["type"] == "conversation.item.input_text.received": + print(f"Text received: {data['text']}") + elif data["type"] == "conversation.item.audio_output.delta": + # Decode base64 audio chunk + audio_chunk = base64.b64decode(data['delta']) + audio_data.extend(audio_chunk) + print(f"Received audio chunk for item {data['item_id']}") + elif data["type"] == "conversation.item.audio_output.done": + print(f"Audio generation complete for item {data['item_id']}") + elif data["type"] == "conversation.item.tts.failed": + error = data.get("error", {}) + print(f"Error: {error.get('message')}") + break - These operations can also be rejected by calling /reject. - operationId: RemediationService_CreateRemediation + # Save the raw PCM samples to a file + with open("output.pcm", "wb") as f: + f.write(audio_data) + print("Audio saved to output.pcm") + + # Run send and receive concurrently + await asyncio.gather(send_text(), receive_audio()) + + asyncio.run(generate_speech()) + - lang: JavaScript + label: Node.js WebSocket Client + source: | + import WebSocket from 'ws'; + import fs from 'fs'; + + const apiKey = process.env.TOGETHER_API_KEY; + const url = 'wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart'; + + const ws = new WebSocket(url, { + headers: { + 'Authorization': `Bearer ${apiKey}` + } + }); + + const audioData = []; + + ws.on('open', () => { + console.log('WebSocket connection established!'); + }); + + ws.on('message', (data) => { + const message = JSON.parse(data.toString()); + + if (message.type === 'session.created') { + console.log(`Session created: ${message.session.id}`); + + // Send text chunks + const textChunks = [ + "Hello, this is a test.", + "This is the second sentence.", + "And this is the final one." + ]; + + textChunks.forEach((text, index) => { + setTimeout(() => { + ws.send(JSON.stringify({ + type: 'input_text_buffer.append', + text: text + })); + }, index * 500); + }); + + // Commit after all chunks + setTimeout(() => { + ws.send(JSON.stringify({ + type: 'input_text_buffer.commit' + })); + }, textChunks.length * 500 + 100); + + } else if (message.type === 'conversation.item.input_text.received') { + console.log(`Text received: ${message.text}`); + } else if (message.type === 'conversation.item.audio_output.delta') { + // Decode base64 audio chunk + const audioChunk = Buffer.from(message.delta, 'base64'); + audioData.push(audioChunk); + console.log(`Received audio chunk for item ${message.item_id}`); + } else if (message.type === 'conversation.item.audio_output.done') { + console.log(`Audio generation complete for item ${message.item_id}`); + } else if (message.type === 'conversation.item.tts.failed') { + const errorMessage = message.error?.message ?? 'Unknown error'; + console.error(`Error: ${errorMessage}`); + ws.close(); + } + }); + + ws.on('close', () => { + // Save the raw PCM samples to a file + if (audioData.length > 0) { + const completeAudio = Buffer.concat(audioData); + fs.writeFileSync('output.pcm', completeAudio); + console.log('Audio saved to output.pcm'); + } + }); + + ws.on('error', (error) => { + console.error('WebSocket error:', error); + }); parameters: - - name: cluster_id - in: path - required: true - schema: - type: string - - name: instance_id - in: path - required: true - schema: - type: string - - name: remediation_id - in: query + - in: query + name: model + required: false schema: - description: Client-specified ID for idempotency. + description: The TTS model to use for speech generation. Can also be set via `tts_session.updated` event. type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Remediation' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Remediation' - /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}: - get: - tags: - - RemediationService - description: >- - Retrieve the status of a specific remdiation on a specific instance in a - specific cluster. - operationId: RemediationService_GetRemediation - parameters: - - name: cluster_id - in: path - required: true + enum: + - hexgrad/Kokoro-82M + - cartesia/sonic-english + default: hexgrad/Kokoro-82M + - in: query + name: voice + required: false schema: type: string - - name: instance_id - in: path - required: true + description: | + The voice to use for speech generation. Default is 'tara'. + Available voices vary by model. Can also be updated via `tts_session.updated` event. + - in: query + name: max_partial_length + required: false schema: - type: string - - name: remediation_id - in: path - required: true + type: integer + default: 250 + description: | + Maximum number of characters in partial text before forcing TTS generation + even without a sentence ending. Helps reduce latency for long text without punctuation. + - in: query + name: language + required: false schema: type: string + default: en + example: en + description: | + Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale codes must be lowercase (e.g., `zh-hk` for Cantonese). Can also be set via `tts_session.updated` event. responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Remediation' - /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/approve: + '101': + description: | + Switching Protocols - WebSocket connection established successfully. + + Error message format: + ```json + { + "type": "conversation.item.tts.failed", + "error": { + "message": "Error description", + "type": "invalid_request_error", + "param": null, + "code": "error_code" + } + } + ``` + /audio/transcriptions: post: - tags: - - RemediationService - description: | - Approves a pending remediation. + tags: ['Audio'] + summary: Create audio transcription request + description: Transcribes audio into text + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together - Only remediations with state PENDING_APPROVAL can be approved. + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) - On APPROVE: state changes to PENDING and the remediation process begins. - The reviewed_by, review_time, and review_comment fields are populated - on the remediation after approval. - operationId: RemediationService_ApproveRemediation - parameters: - - name: cluster_id - in: path - required: true - schema: - type: string - - name: instance_id - in: path - required: true - schema: - type: string - - name: remediation_id - in: path - required: true - schema: - type: string + file = open("audio.wav", "rb") + + response = client.audio.transcriptions.create( + model="openai/whisper-large-v3", + file=file, + ) + + print(response.text) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = open("audio.wav", "rb") + + response = client.audio.transcriptions.create( + model="openai/whisper-large-v3", + file=file, + ) + + print(response.text) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.transcriptions.create({ + model: "openai/whisper-large-v3", + file: audioFile, + }); + + console.log(response.text); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.transcriptions.create({ + model: "openai/whisper-large-v3", + file: audioFile, + }); + + console.log(response.text); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/transcriptions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -F "file=@audio.wav" \ + -F "model=openai/whisper-large-v3" + operationId: audio-transcriptions requestBody: + required: true content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/CommentBody' - required: true + $ref: '#/components/schemas/AudioTranscriptionRequest' responses: '200': - description: OK + description: 'OK' content: application/json: schema: - $ref: '#/components/schemas/Remediation' - /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/cancel: + $ref: '#/components/schemas/AudioTranscriptionResponse' + '400': + description: >- + BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation). + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '413': + description: >- + Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side). + content: + text/html: + schema: + type: string + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /audio/translations: post: - tags: - - RemediationService - description: | - Cancels a pending remediation. + tags: ['Audio'] + summary: Create audio translation request + description: Translates audio into English + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os - Only remediations in PENDING_APPROVAL or PENDING state can be cancelled. - operationId: RemediationService_CancelRemediation - parameters: - - name: cluster_id - in: path - required: true - schema: - description: The cluster ID. - type: string - - name: instance_id - in: path - required: true - schema: - description: The instance ID. - type: string - - name: remediation_id - in: path - required: true - schema: - description: The remediation ID. - type: string + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = open("audio.wav", "rb") + + response = client.audio.translations.create( + model="openai/whisper-large-v3", + file=file, + language="es", + ) + + print(response.text) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = open("audio.wav", "rb") + + response = client.audio.translations.create( + model="openai/whisper-large-v3", + file=file, + language="es", + ) + + print(response.text) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.translations.create({ + model: "openai/whisper-large-v3", + file: audioFile, + language: "es" + }); + + console.log(response.text); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.translations.create({ + model: "openai/whisper-large-v3", + file: audioFile, + language: "es" + }); + + console.log(response.text); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/translations" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -F "file=@audio.wav" \ + -F "model=openai/whisper-large-v3" \ + -F "language=es" + operationId: audio-translations + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/AudioTranslationRequest' responses: '200': - description: OK + description: 'OK' content: application/json: schema: - $ref: '#/components/schemas/Remediation' - /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/reject: - post: - tags: - - RemediationService - description: | - Rejects a pending remediation. - - Only remediations with state PENDING_APPROVAL can be rejected. - - On REJECT: state changes to CANCELLED. - The reviewed_by, review_time, and review_comment fields are populated - on the remediation after rejection. - operationId: RemediationService_RejectRemediation + $ref: '#/components/schemas/AudioTranslationResponse' + '400': + description: >- + BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation). + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '413': + description: >- + Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side). + content: + text/html: + schema: + type: string + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /compute/clusters: + get: + tags: ['GPUClusterService'] + summary: List all GPU clusters + description: List all GPU clusters. + operationId: GPUClusterService_List + parameters: + - name: projectId + in: query + schema: + description: |- + Optional UMS project ID to filter clusters by. When set, only clusters + belonging to this project are returned. The caller must be a member of + the project; otherwise the result set will be empty. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusters' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.beta.clusters.list() + + print(response.clusters) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.beta.clusters.list(); + + console.log(response.clusters); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.beta.clusters.list(); + + console.log(response.clusters); + - lang: Shell + label: CLI + source: tg beta clusters list + post: + tags: ['GPUClusterService'] + summary: Create a GPU cluster + description: | + Create an Instant Cluster on Together's high-performance GPU clusters. + With features like on-demand scaling, long-lived resizable high-bandwidth shared DC-local storage, + Kubernetes and Slurm cluster flavors, a REST API, and Terraform support, + you can run workloads flexibly without complex infrastructure management. + operationId: GPUClusterService_Create + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterCreateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterInfo' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + + client = Together() + + response = client.beta.clusters.create( + cluster_name="my-gpu-cluster", + region="us-central-8", + gpu_type="H100_SXM", + num_gpus=8, + nvidia_driver_version="560", + cuda_version="12.6", + billint_type="ON_DEMAND", + ) + + print(response.cluster_id) + - lang: TypeScript + label: Together AI SDK (v2) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const response = await client.beta.clusters.create({ + cluster_name: "my-gpu-cluster", + region: "us-central-8", + gpu_type: "H100_SXM", + num_gpus: 8, + nvidia_driver_version: "560", + cuda_version: "12.6", + billint_type: "ON_DEMAND", + }); + + console.log(response.cluster_id) + - lang: JavaScript + label: Together AI SDK (v2) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const response = await client.beta.clusters.create({ + cluster_name: "my-gpu-cluster", + region: "us-central-8", + gpu_type: "H100_SXM", + num_gpus: 8, + nvidia_driver_version: "560", + cuda_version: "12.6", + billint_type: "ON_DEMAND", + }); + + console.log(response.cluster_id) + - lang: Shell + label: CLI + source: | + tg beta clusters create \ + --name my-gpu-cluster \ + --region us-central-8 \ + --gpu-type H100_SXM \ + --cluster-type KUBERNETES \ + --num-gpus 8 \ + --billing-type ON_DEMAND \ + --nvidia-driver-version 560 \ + --cuda-version 12.6 + /compute/clusters/{cluster_id}: + get: + tags: ['GPUClusterService'] + summary: Get GPU cluster by cluster ID + description: Retrieve information about a specific GPU cluster. + operationId: GPUClusterService_Get + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster to retrieve + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterInfo' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.retrieve("cluster_id") + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.retrieve("cluster_id"); + console.log(cluster); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.retrieve("cluster_id"); + console.log(cluster); + - lang: Shell + label: CLI + source: | + tg beta clusters get + put: + tags: ['GPUClusterService'] + summary: Update a GPU cluster + description: Update the configuration of an existing GPU cluster. + operationId: GPUClusterService_Update parameters: - name: cluster_id in: path required: true schema: + description: The ID of the cluster to update + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterUpdateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterInfo' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24) + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.update({ + cluster_id: "cluster_id", + cluster_type: "KUBERNETES", + num_gpus: 24, + }) + console.log(cluster) + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.update({ + cluster_id: "cluster_id", + cluster_type: "KUBERNETES", + num_gpus: 24, + }) + console.log(cluster) + - lang: Shell + label: CLI + source: | + tg beta clusters update \ + --cluster-type KUBERNETES \ + --num-gpus 24 + delete: + tags: ['GPUClusterService'] + summary: Delete GPU cluster by cluster ID + description: Delete a GPU cluster by cluster ID. + operationId: GPUClusterService_Delete + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster to delete + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClusterDeleteResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.delete("cluster_id") + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.delete("cluster_id"); + console.log(cluster); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.delete("cluster_id"); + console.log(cluster); + - lang: Shell + label: CLI + source: | + tg beta clusters delete + /compute/regions: + get: + tags: ['RegionService'] + summary: List regions and corresponding supported driver versions + operationId: RegionService_List + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RegionListResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + regions = client.beta.clusters.list_regions() + print(regions) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const regions = await client.beta.clusters.list_regions(); + console.log(regions); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const regions = await client.beta.clusters.list_regions(); + console.log(regions); + - lang: Shell + label: CLI + source: | + tg beta clusters list-regions + /compute/clusters/storage/volumes: + get: + tags: ['SharedVolumeService'] + summary: List all shared volumes + description: List all shared volumes. + operationId: SharedVolumeService_List + parameters: + - name: projectId + in: query + schema: + description: |- + Optional UMS project ID to filter volumes by. When set, only volumes + belonging to this project are returned. The caller must be a member of + the project; otherwise the result set will be empty. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolumes' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + volumes = client.beta.clusters.storage.list() + print(volumes) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.clusters.storage.list(); + console.log(volumes); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.clusters.storage.list(); + console.log(volumes); + - lang: Shell + label: CLI + source: | + tg beta clusters storage list + put: + tags: ['SharedVolumeService'] + summary: Update a shared volume + description: | + Update the configuration of an existing shared volume. + operationId: SharedVolumeService_Update + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolumeUpdateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolume' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.update( + volume_id="12345-67890-12345-67890", + size_tib=3 + ) + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.update({ + volume_id: "12345-67890-12345-67890", + size_tib: 3 + }); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.update({ + volume_id: "12345-67890-12345-67890", + size_tib: 3 + }); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage update --size-tib 3 + post: + tags: ['SharedVolumeService'] + summary: Create a shared volume + description: | + Instant Clusters supports long-lived, resizable in-DC shared storage with user data persistence. + You can dynamically create and attach volumes to your cluster at cluster creation time, and resize as your data grows. + All shared storage is backed by multi-NIC bare metal paths, ensuring high-throughput and low-latency performance for shared storage. + operationId: SharedVolumeService_Create + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolumeCreateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolume' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.create( + volume_name="my-shared-volume", + size_tib=2, + region="us-west-2" + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.create({ + volume_name: "my-shared-volume", + size_tib: 2, + region: "us-west-2" + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.create({ + volume_name: "my-shared-volume", + size_tib: 2, + region: "us-west-2" + }); + - lang: Shell + label: cURL + source: | + tg beta clusters storage create \ + --volume-name my-shared-volume \ + --size-tib 2 \ + --region us-west-2 + /compute/clusters/storage/volumes/{volume_id}: + get: + tags: ['SharedVolumeService'] + summary: Get a shared volume by ID + description: Retrieve information about a specific shared volume. + operationId: SharedVolumeService_Get + parameters: + - name: volume_id + in: path + required: true + schema: + description: The ID of the volume to retrieve + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolume' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.retrieve("volume_id") + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.retrieve("volume_id"); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.retrieve("volume_id"); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage retrieve + delete: + tags: ['SharedVolumeService'] + summary: Delete a shared volume by ID + description: | + Delete a shared volume. Note that if this volume is attached to a cluster, deleting will fail. + operationId: SharedVolumeService_Delete + parameters: + - name: volume_id + in: path + required: true + schema: + description: The ID of the volume to delete + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GPUClustersSharedVolumeDeleteResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.delete("volume_id") + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.delete("volume_id"); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.delete("volume_id"); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage delete + /clusters/availability-zones: + get: + tags: ['endpoints'] + summary: List all available availability zones + description: List all available availability zones. + operationId: availabilityZones + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ListAvailibilityZonesResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list_avzones() + + print(response.avzones) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.endpoints.listAvzones(); + + console.log(response.avzones); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.endpoints.listAvzones(); + + console.log(response.avzones); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/clusters/availability-zones" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /endpoints: + get: + tags: ['Endpoints'] + summary: List all endpoints + description: Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list() + + for endpoint in response.data: + print(endpoint.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoints = client.endpoints.list() + + for endpoint in endpoints: + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoints = await client.endpoints.list(); + + for (const endpoint of endpoints.data) { + console.log(endpoint); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoints = await client.endpoints.list(); + + for (const endpoint of endpoints.data) { + console.log(endpoint); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + operationId: listEndpoints + parameters: + - name: type + in: query + required: false + schema: + description: Filter endpoints by type + type: string + enum: + - dedicated + - serverless + - name: usage_type + in: query + required: false + schema: + type: string + enum: + - on-demand + - reserved + description: Filter endpoints by usage type + - name: mine + in: query + required: false + schema: + type: boolean + description: If true, return only endpoints owned by the caller + responses: + '200': + description: '200' + content: + application/json: + schema: + type: object + required: + - object + - data + properties: + object: + description: The object type, which is always `list`. + const: list + data: + type: array + items: + $ref: '#/components/schemas/ListEndpoint' + example: + object: 'list' + data: + - object: 'endpoint' + id: 'endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e' + name: 'allenai/OLMo-7B' + model: 'allenai/OLMo-7B' + type: 'serverless' + owner: 'together' + state: 'STARTED' + created_at: '2024-02-28T21:34:35.444Z' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + post: + tags: ['Endpoints'] + summary: Create a dedicated endpoint + description: Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.create( + model="Qwen/Qwen3.5-9B-FP8", + hardware="1x_nvidia_a100_80gb_sxm", + autoscaling={ + "min_replicas": 2, + "max_replicas": 5, + } + ) + + print(endpoint.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.create( + model="Qwen/Qwen3.5-9B-FP8", + hardware="1x_nvidia_a100_80gb_sxm", + min_replicas=2, + max_replicas=5, + ) + + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.create({ + model: "Qwen/Qwen3.5-9B-FP8", + hardware: "1x_nvidia_a100_80gb_sxm", + autoscaling: { + max_replicas: 5, + min_replicas: 2, + } + }); + + console.log(endpoint.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.create({ + model: "Qwen/Qwen3.5-9B-FP8", + hardware: "1x_nvidia_a100_80gb_sxm", + autoscaling: { + max_replicas: 5, + min_replicas: 2, + } + }); + + console.log(endpoint.id); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/endpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B-FP8", + "hardware": "1x_nvidia_a100_80gb_sxm", + "autoscaling": { + "max_replicas": 5, + "min_replicas": 2 + } + }' + operationId: createEndpoint + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEndpointRequest' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/DedicatedEndpoint' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + /endpoints/{endpointId}: + get: + tags: ['Endpoints'] + summary: Get endpoint by ID + description: Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.retrieve("endpoint-id") + + print(endpoint.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.get("endpoint-id") + + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.retrieve("endpoint-id"); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.retrieve("endpoint-id"); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints/endpoint-id" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + operationId: getEndpoint + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The ID of the endpoint to retrieve + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/DedicatedEndpoint' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + patch: + tags: ['Endpoints'] + summary: Update endpoint, this can also be used to start or stop a dedicated endpoint + description: Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.update( + "endpoint-id", + state="STOPPED" + ) + + print(endpoint) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.update( + endpoint_id="endpoint-id", + state="STOPPED" + ) + + print(endpoint) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.update("endpoint-id", { + state: "STOPPED" + }); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.update("endpoint-id", { + state: "STOPPED" + }); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl -X PATCH "https://api.together.ai/v1/endpoints/endpoint-id" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "state": "STOPPED" + }' + operationId: updateEndpoint + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The ID of the endpoint to update + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + display_name: + type: string + description: A human-readable name for the endpoint + example: My Llama3 70b endpoint + state: + type: string + description: The desired state of the endpoint + enum: + - STARTED + - STOPPED + example: STARTED + autoscaling: + $ref: '#/components/schemas/Autoscaling' + description: New autoscaling configuration for the endpoint + inactive_timeout: + type: integer + description: The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout. + nullable: true + example: 60 + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/DedicatedEndpoint' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + delete: + tags: ['Endpoints'] + summary: Delete endpoint + description: Permanently deletes an endpoint. This action cannot be undone. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.delete("endpoint-id") + + print(endpoint) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.delete( + endpoint_id="endpoint-id", + ) + + print(endpoint) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.delete("endpoint-id"); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.delete("endpoint-id"); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl -X "DELETE" "https://api.together.ai/v1/endpoints/endpoint-id" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + operationId: deleteEndpoint + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The ID of the endpoint to delete + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + responses: + '204': + description: 'No Content - Endpoint successfully deleted' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + /endpoints/{endpointId}/adapters: + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The endpoint ID + post: + tags: ['Endpoints'] + summary: Add a LoRA adapter to an endpoint + description: | + Adds a LoRA adapter model to a dedicated endpoint. After this call, + inference requests to the adapter model name will be routed to the + specified endpoint. The endpoint must have LoRA enabled, and the + adapter's base model must be compatible with the endpoint's model. + The endpoint name prefix in model_id must match the resolved endpoint. + operationId: addAdapter + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + result = client.endpoints.adapters.add( + "endpoint-abc123", + model_id="username/my-endpoint-name:username/my-adapter-model", + ) + print(result.api_model_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const result = await client.endpoints.adapters.add("endpoint-abc123", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + console.log(result.model_id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const result = await client.endpoints.adapters.add("endpoint-abc123", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + console.log(result.model_id); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/endpoints/endpoint-abc123/adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"model_id": "username/my-endpoint-name:username/my-adapter-model"}' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - model_id + properties: + model_id: + type: string + description: 'Combined identifier in format "endpoint_name:adapter_model_name".' + example: 'username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123' + responses: + '200': + description: Adapter successfully bound to endpoint + content: + application/json: + schema: + type: object + properties: + model_id: + type: string + '400': + description: 'Bad Request — invalid model_id format, endpoint name mismatch, LoRA not enabled, incompatible base model, or adapter already bound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '403': + description: 'Forbidden — adapter model not found or not owned' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + get: + tags: ['Endpoints'] + summary: List adapters on an endpoint + description: Returns all LoRA adapters bound to the specified dedicated endpoint. + operationId: listAdapters + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + adapters = client.endpoints.adapters.list("endpoint-abc123") + for adapter in adapters.data or []: + print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const adapters = await client.endpoints.adapters.list("endpoint-abc123"); + for (const adapter of adapters.data ?? []) { + console.log(adapter.model_id, adapter.adapter_name, adapter.endpoint_name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const adapters = await client.endpoints.adapters.list("endpoint-abc123"); + for (const adapter of adapters.data ?? []) { + console.log(adapter.model_id, adapter.adapter_name, adapter.endpoint_name); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints/endpoint-abc123/adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + responses: + '200': + description: List of bound adapters + content: + application/json: + schema: + type: object + properties: + object: + type: string + example: 'list' + data: + type: array + items: + type: object + properties: + model_id: + type: string + description: 'Combined endpoint:adapter identifier' + adapter_name: + type: string + endpoint_name: + type: string + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + delete: + tags: ['Endpoints'] + summary: Remove a LoRA adapter from an endpoint + description: | + Removes the routing rule that binds an adapter to an endpoint. + The adapter must be currently bound to this specific endpoint. + operationId: removeAdapter + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + client.endpoints.adapters.remove( + "endpoint-abc123", + model_id="username/my-endpoint-name:username/my-adapter-model", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + await client.endpoints.adapters.remove("endpoint-abc123", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + await client.endpoints.adapters.remove("endpoint-abc123", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + - lang: Shell + label: cURL + source: | + curl -X DELETE "https://api.together.ai/v1/endpoints/endpoint-abc123/adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"model_id": "username/my-endpoint-name:username/my-adapter-model"}' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - model_id + properties: + model_id: + type: string + description: 'Combined identifier in format "endpoint_name:adapter_model_name".' + responses: + '200': + description: Adapter successfully unbound + content: + application/json: + schema: + type: object + properties: + model_id: + type: string + deleted: + type: boolean + '400': + description: 'Bad Request — invalid model_id format, or adapter not bound to this endpoint' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '403': + description: 'Forbidden — adapter model not found or not owned' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + + /hardware: + get: + tags: ['Hardware'] + summary: List available hardware configurations + description: > + Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list_hardware() + + for hardware in response.data: + print(hardware.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list_hardware() + + for hardware in response: + print(hardware.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const hardware = await client.endpoints.list_hardware(); + + console.log(hardware); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const hardware = await client.endpoints.list_hardware(); + + console.log(hardware); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/hardware" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + operationId: listHardware + parameters: + - name: model + in: query + required: false + schema: + type: string + description: | + Filter hardware configurations by model compatibility. When provided, + the response includes availability status for each compatible configuration. + [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models) + example: deepseek-ai/DeepSeek-R1 + responses: + '200': + description: 'List of available hardware configurations' + content: + application/json: + schema: + type: object + required: + - object + - data + properties: + object: + description: The object type, which is always `list`. + const: list + data: + type: array + items: + $ref: '#/components/schemas/HardwareWithStatus' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /tci/execute: + post: + tags: ['Code Interpreter'] + summary: Execute code + callbacks: {} + description: | + Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted + between calls to the same session. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.code_interpreter.execute( + code="print('Hello world!')", + language="python", + ) + + print(response.data.outputs[0].data); + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.code_interpreter.run( + code="print('Hello world!')", + language="python", + ) + + print(response.data.outputs[0].data); + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.execute({ + code: "print('Hello world!')", + language: "python" + }); + + console.log(response.data?.outputs?.[0]?.data); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.execute({ + code: "print('Hello world!')", + language: "python" + }); + + console.log(response.data?.outputs?.[0]?.data); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/tci/execute" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "code": "print(\'Hello world!\')", + "language": "python" + }' + operationId: tci/execute + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteRequest' + description: Execute Request + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteResponse' + description: Execute Response + /tci/sessions: + get: + summary: List active sessions + tags: ['Code Interpreter'] + callbacks: {} + description: | + Lists all your currently active sessions. + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.code_interpreter.sessions.list() + + for session in response.data.sessions: + print(session.id) + - lang: Python + label: Together AI SDK (v1) + source: | + # together v1 does not support this method + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.sessions.list(); + + for (const session of response.data?.sessions) { + console.log(session.id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.sessions.list(); + + for (const session of response.data?.sessions) { + console.log(session.id); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/tci/sessions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + operationId: sessions/list + parameters: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SessionListResponse' + description: List Response + /batches: + get: + tags: ['Batches'] + summary: List batch jobs + description: List all batch jobs for the authenticated user + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batches = client.batches.list() + + for batch in batches: + print(batch.id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batches = client.batches.list_batches() + + for batch in batches: + print(batch.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batches = await client.batches.list(); + + console.log(batches); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batches = await client.batches.list(); + + console.log(batches); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + security: + - bearerAuth: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BatchJob' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + post: + tags: ['Batches'] + summary: Create a batch job + description: Create a new batch job with the given input file and endpoint + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.create(input_file_id="file_id", endpoint="/v1/chat/completions") + + print(batch.job) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.create_batch("file_id", endpoint="/v1/chat/completions") + + print(batch.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.create({ + endpoint: "/v1/chat/completions", + input_file_id: "file-id", + }); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.create({ + endpoint: "/v1/chat/completions", + input_file_id: "file-id", + }); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "endpoint": "/v1/chat/completions", + "input_file_id": "file-id" + }' + - lang: Python + label: Audio transcriptions (Python) + source: | + # Audio transcription batches use the /v1/audio/transcriptions endpoint. + # Each line in the uploaded JSONL must include `"method": "FILE"` so the + # worker dispatches the request as multipart/form-data. Example line: + # {"custom_id": "transcription-1", "method": "FILE", + # "body": {"file": "https://example.com/audio.wav", + # "model": "openai/whisper-large-v3"}} + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.create( + input_file_id="file_id", + endpoint="/v1/audio/transcriptions", + ) + + print(batch.job) + - lang: Shell + label: Audio transcriptions (cURL) + source: | + curl -X POST "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "endpoint": "/v1/audio/transcriptions", + "input_file_id": "file-id" + }' + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBatchRequest' + responses: + '201': + description: Job created (potentially with warnings) + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJobWithWarning' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + + /batches/{id}: + get: + tags: ['Batches'] + summary: Get a batch job + description: Get details of a batch job by ID + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.retrieve("batch_id") + + print(batch) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.get_batch("batch_id") + + print(batch) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.retrieve("batch-id"); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.retrieve("batch-id"); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/batches/ID" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The ID of the batch job to retrieve + example: batch_job_abc123def456 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJob' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + /batches/{id}/cancel: + post: + tags: ['Batches'] + summary: Cancel a batch job + description: Cancel a batch job by ID + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.cancel("batch_id") + + print(batch) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.cancel("batch_id") + + print(batch) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.cancel("batch-id"); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.cancel("batch-id"); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/batches/ID/cancel" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The ID of the batch job to cancel + example: batch_job_abc123def456 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJob' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + /evaluation: + post: + tags: + - evaluation + summary: Create an evaluation job + operationId: createEvaluationJob + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.create( + type="classify", + parameters=ParametersEvaluationClassifyParameters( + judge=ParametersEvaluationClassifyParametersJudge( + model="openai/gpt-oss-120b", + model_source="serverless", + system_template="You are an expert evaluator...", + ), + input_data_file_path="file-abc123", + labels=["good", "bad"], + pass_labels=["good"], + model_to_evaluate="Qwen/Qwen3.5-9B" + ) + ) + + print(response.workflow_id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evaluation.create( + type="classify", + judge_model_name="openai/gpt-oss-120b", + judge_system_template="You are an expert evaluator...", + input_data_file_path="file-abc123", + labels=["good", "bad"], + pass_labels=["good"], + model_to_evaluate="Qwen/Qwen3.5-9B" + ) + + print(response.workflow_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.create({ + type: 'classify', + parameters: { + judge: { + model: 'openai/gpt-oss-120b', + model_source: 'serverless', + system_template: 'You are an expert evaluator...', + }, + input_data_file_path: 'file-abc123', + labels: ['good', 'bad'], + pass_labels: ['good'], + model_to_evaluate: 'Qwen/Qwen3.5-9B', + }, + }); + + console.log(response.workflow_id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.create({ + type: 'classify', + parameters: { + judge: { + model: 'openai/gpt-oss-120b', + model_source: 'serverless', + system_template: 'You are an expert evaluator...', + }, + input_data_file_path: 'file-abc123', + labels: ['good', 'bad'], + pass_labels: ['good'], + model_to_evaluate: 'Qwen/Qwen3.5-9B', + }, + }); + + console.log(response.workflow_id); + + + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/EvaluationTypedRequest" + responses: + "200": + description: "Evaluation job created successfully" + content: + application/json: + schema: + $ref: "#/components/schemas/EvaluationResponse" + "400": + description: "Invalid request format" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + "500": + description: "Failed to create evaluation job" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + get: + tags: + - evaluation + summary: Get all evaluation jobs + operationId: getAllEvaluationJobs + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.list() + + for job in response: + print(job.workflow_id) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + jobs = client.evaluation.list() + + for job in jobs: + print(job.workflow_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.list(); + + for (const job of response) { + console.log(job.workflow_id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.list(); + + for (const job of response) { + console.log(job.workflow_id); + } + parameters: + - name: status + in: query + required: false + schema: + type: string + description: Filter evaluation jobs by status + - name: limit + in: query + required: false + schema: + type: integer + default: 10 + description: Limit the number of results + responses: + "200": + description: "evaluation jobs retrieved successfully" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/EvaluationJob" + "400": + description: "Invalid request format" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + "500": + description: "Error retrieving jobs from manager" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + /evaluation/model-list: + get: + tags: + - evaluation + summary: Get model list + operationId: getModelList + parameters: + - name: model_source + in: query + required: false + schema: + type: string + description: Filter models by source + default: "all" + responses: + "200": + description: "Model list retrieved successfully" + content: + application/json: + schema: + type: object + properties: + model_list: + type: array + items: + type: string + description: "The name of the model" + "400": + description: "Invalid request format" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + "500": + description: "Error retrieving model list" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + /evaluation/{id}: + get: + tags: + - evaluation + summary: Get evaluation job details + operationId: getEvaluationJobDetails + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.retrieve('eval_id') + + print(response) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evaluation.retrieve('eval_id') + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.retrieve('eval_id'); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.retrieve('eval_id'); + + console.log(response); + parameters: + - name: id + in: path + required: true + schema: + description: The ID of the evaluation job to retrieve + type: string + responses: + "200": + description: "Evaluation job details retrieved successfully" + content: + application/json: + schema: + $ref: "#/components/schemas/EvaluationJob" + "404": + description: "Evaluation job not found" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + "500": + description: "Failed to get evaluation job" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + + /evaluation/{id}/status: + get: + tags: + - evaluation + summary: Get evaluation job status and results + operationId: getEvaluationJobStatusAndResults + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + # Docs for v1 can be found by changing the above selector ^ + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.status('eval_id') + + print(response.status) + print(response.results) + - lang: Python + label: Together AI SDK (v1) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evaluation.status('eval_id') + + print(response.status) + print(response.results) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.status('eval_id'); + + console.log(response.status); + console.log(response.results); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.status('eval_id'); + + console.log(response.status); + console.log(response.results); + parameters: + - name: id + in: path + required: true + schema: + description: The ID of the evaluation job to get the status of + type: string + responses: + "200": + description: "Evaluation job status and results retrieved successfully" + content: + application/json: + schema: + type: object + properties: + status: + type: string + description: "The status of the evaluation job" + enum: ["completed", "error", "user_error", "running", "queued", "pending"] + results: + description: "The results of the evaluation job" + oneOf: + - $ref: "#/components/schemas/EvaluationClassifyResults" + - $ref: "#/components/schemas/EvaluationScoreResults" + - $ref: "#/components/schemas/EvaluationCompareResults" + "404": + description: "Evaluation job not found" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + "500": + description: "Failed to get evaluation job" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorData" + + /realtime: + get: + tags: ['Audio'] + summary: Real-time audio transcription via WebSocket + description: | + Establishes a WebSocket connection for real-time audio transcription. This endpoint uses WebSocket protocol (wss://api.together.ai/v1/realtime) for bidirectional streaming communication. + + **Connection Setup:** + - Protocol: WebSocket (wss://) + - Authentication: Pass API key as Bearer token in Authorization header + - Parameters: Sent as query parameters (model, input_audio_format) + + **Client Events:** + - `input_audio_buffer.append`: Send audio chunks as base64-encoded data + ```json + { + "type": "input_audio_buffer.append", + "audio": "" + } + ``` + - `input_audio_buffer.commit`: Signal end of audio stream. When VAD is enabled, the server automatically detects speech boundaries and emits `completed` events. When VAD is disabled, you must send `commit` to trigger transcription of the buffered audio. + ```json + { + "type": "input_audio_buffer.commit" + } + ``` + - `transcription_session.updated`: Update session configuration, including Voice Activity Detection (VAD) parameters. Send this after receiving `session.created`. Can also be sent at any time during the session to change VAD settings. + ```json + { + "type": "transcription_session.updated", + "session": { + "turn_detection": { + "type": "server_vad", + "threshold": 0.3, + "min_silence_duration_ms": 500, + "min_speech_duration_ms": 250, + "max_speech_duration_s": 5.0, + "speech_pad_ms": 250 + } + } + } + ``` + To disable VAD entirely (manual commit mode), set `turn_detection` to `null`: + ```json + { + "type": "transcription_session.updated", + "session": { + "turn_detection": null + } + } + ``` + + **Voice Activity Detection (VAD)** + + VAD controls how the server automatically detects speech segments in the audio stream. When enabled (the default), the server uses Silero VAD to identify speech regions and emits transcription events as each segment completes. When disabled, you must manually call `input_audio_buffer.commit` to trigger transcription. + + VAD can be configured in two ways: + 1. **Query parameters** at connection time: `turn_detection=server_vad&threshold=0.3&min_silence_duration_ms=500` + 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above) + + To disable VAD at connection time, use `turn_detection=none` as a query parameter. + + **VAD Parameters:** + + All parameters are Omitted fields use their defaults. + + | Parameter | Type | Default | Description | + |-----------|------|---------|-------------| + | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. | + | `threshold` | float | `0.3` | Speech probability threshold (0.0–1.0). Audio frames with probability above this value are classified as speech. Lower values detect more speech but may increase false positives. For low-SNR audio (e.g., 8kHz phone calls), values of 0.01–0.2 may work better. | + | `min_silence_duration_ms` | int | `500` | Minimum silence duration in milliseconds before ending a speech segment. Higher values merge nearby speech bursts into single segments. For phone calls with mid-sentence pauses, 2000–5000ms prevents over-segmentation. | + | `min_speech_duration_ms` | int | `250` | Minimum speech segment duration in milliseconds. Segments shorter than this are discarded. Filters out brief noise bursts or clicks. | + | `max_speech_duration_s` | float | `5.0` | Maximum speech segment duration in seconds. Segments longer than this are force-split at the longest internal silence gap. Useful for continuous speech without natural pauses. | + | `speech_pad_ms` | int | `250` | Padding in milliseconds added to the start and end of each detected segment. Prevents clipping speech edges. When padding would cause adjacent segments to overlap, the gap is split at the midpoint instead. | + + **Server Events:** + - `session.created`: Initial session confirmation (sent first) + ```json + { + "type": "session.created", + "session": { + "id": "session-id", + "object": "realtime.session", + "modalities": ["audio"], + "model": "openai/whisper-large-v3" + } + } + ``` + - `transcription_session.updated`: Confirms session configuration was applied. Sent in response to a client `transcription_session.updated` message. + ```json + { + "type": "transcription_session.updated", + "session": { + "turn_detection": { + "type": "server_vad", + "threshold": 0.3, + "min_silence_duration_ms": 500, + "min_speech_duration_ms": 250, + "max_speech_duration_s": 5.0, + "speech_pad_ms": 250 + } + } + } + ``` + - `conversation.item.input_audio_transcription.delta`: Partial transcription results + ```json + { + "type": "conversation.item.input_audio_transcription.delta", + "delta": "The quick brown" + } + ``` + - `conversation.item.input_audio_transcription.completed`: Final transcription + ```json + { + "type": "conversation.item.input_audio_transcription.completed", + "transcript": "The quick brown fox jumps over the lazy dog" + } + ``` + - `conversation.item.input_audio_transcription.failed`: Error occurred + ```json + { + "type": "conversation.item.input_audio_transcription.failed", + "error": { + "message": "Error description", + "type": "invalid_request_error", + "param": null, + "code": "invalid_api_key" + } + } + ``` + + **Error Codes:** + - `invalid_api_key`: Invalid API key provided (401) + - `missing_api_key`: Authorization header missing (401) + - `model_not_available`: Invalid or unavailable model (400) + - Unsupported audio format errors (400) + + operationId: realtime-transcription + x-codeSamples: + - lang: Python + label: Python WebSocket Client + source: | + import asyncio + import websockets + import json + import base64 + import os + + async def transcribe_audio(): + api_key = os.environ.get("TOGETHER_API_KEY") + url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000" + + headers = { + "Authorization": f"Bearer {api_key}" + } + + async with websockets.connect(url, additional_headers=headers) as ws: + # Read audio file + with open("audio.wav", "rb") as f: + audio_data = f.read() + + # Send audio in chunks with delay to simulate real-time + chunk_size = 8192 + bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit) + delay_per_chunk = chunk_size / bytes_per_second + + for i in range(0, len(audio_data), chunk_size): + chunk = audio_data[i:i+chunk_size] + base64_chunk = base64.b64encode(chunk).decode('utf-8') + await ws.send(json.dumps({ + "type": "input_audio_buffer.append", + "audio": base64_chunk + })) + # Simulate real-time streaming + if i + chunk_size < len(audio_data): + await asyncio.sleep(delay_per_chunk) + + # Commit the audio buffer + await ws.send(json.dumps({ + "type": "input_audio_buffer.commit" + })) + + # Receive transcription results + async for message in ws: + data = json.loads(message) + if data["type"] == "conversation.item.input_audio_transcription.delta": + print(f"Partial: {data['delta']}") + elif data["type"] == "conversation.item.input_audio_transcription.completed": + print(f"Final: {data['transcript']}") + break + elif data["type"] == "conversation.item.input_audio_transcription.failed": + error = data.get("error", {}) + print(f"Error: {error.get('message')}") + break + + asyncio.run(transcribe_audio()) + - lang: JavaScript + label: Node.js WebSocket Client + source: | + import WebSocket from 'ws'; + import fs from 'fs'; + + const apiKey = process.env.TOGETHER_API_KEY; + const url = 'wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000'; + + const ws = new WebSocket(url, { + headers: { + 'Authorization': `Bearer ${apiKey}` + } + }); + + ws.on('open', async () => { + console.log('WebSocket connection established!'); + + // Read audio file + const audioData = fs.readFileSync('audio.wav'); + + // Send audio in chunks with delay to simulate real-time + const chunkSize = 8192; + const bytesPerSecond = 16000 * 2; // 16kHz * 2 bytes (16-bit) + const delayPerChunk = (chunkSize / bytesPerSecond) * 1000; // Convert to ms + + for (let i = 0; i < audioData.length; i += chunkSize) { + const chunk = audioData.slice(i, i + chunkSize); + const base64Chunk = chunk.toString('base64'); + ws.send(JSON.stringify({ + type: 'input_audio_buffer.append', + audio: base64Chunk + })); + + // Simulate real-time streaming + if (i + chunkSize < audioData.length) { + await new Promise(resolve => setTimeout(resolve, delayPerChunk)); + } + } + + // Commit audio buffer + ws.send(JSON.stringify({ + type: 'input_audio_buffer.commit' + })); + }); + + ws.on('message', (data) => { + const message = JSON.parse(data.toString()); + + if (message.type === 'conversation.item.input_audio_transcription.delta') { + console.log(`Partial: ${message.delta}`); + } else if (message.type === 'conversation.item.input_audio_transcription.completed') { + console.log(`Final: ${message.transcript}`); + ws.close(); + } else if (message.type === 'conversation.item.input_audio_transcription.failed') { + const errorMessage = message.error?.message ?? message.message ?? 'Unknown error'; + console.error(`Error: ${errorMessage}`); + ws.close(); + } + }); + + ws.on('error', (error) => { + console.error('WebSocket error:', error); + }); + parameters: + - in: query + name: model + required: true + schema: + type: string + description: The Whisper model to use for transcription + - in: query + name: input_audio_format + required: true + schema: + type: string + enum: + - pcm_s16le_16000 + default: pcm_s16le_16000 + description: Audio format specification. Currently supports 16-bit PCM at 16kHz sample rate. + responses: + '101': + description: | + Switching Protocols - WebSocket connection established successfully. + + Error message format: + ```json + { + "type": "conversation.item.input_audio_transcription.failed", + "error": { + "message": "Error description", + "type": "invalid_request_error", + "param": null, + "code": "error_code" + } + } + ``` + + /queue/cancel: + post: + description: | + Cancel a pending job. Only jobs in pending status can be canceled. + Running jobs cannot be stopped. Returns the job status after the + attempt. If the job is not pending, returns 409 with the current status + unchanged. + operationId: cancelQueueJob + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/QueueCancelRequest" + description: Cancel request + required: true + responses: + "200": + description: Successfully canceled + content: + application/json: + schema: + $ref: "#/components/schemas/QueueCancelResponse" + "400": + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "404": + description: Request not found + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "409": + description: Job could not be canceled (already completed/failed) + content: + application/json: + schema: + $ref: "#/components/schemas/QueueCancelResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + summary: Cancel a queued job + tags: + - Queue + /queue/clear: + post: + description: Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. + operationId: clearQueue + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/QueueClearRequest" + description: Clear request + required: true + responses: + "200": + description: Pending jobs canceled + content: + application/json: + schema: + $ref: "#/components/schemas/QueueClearResponse" + "400": + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + summary: Clear a model's pending jobs + tags: + - Queue + /queue/metrics: + get: + description: Get the current queue statistics for a model, including pending and running job counts. + operationId: getQueueMetrics + parameters: + - name: model + in: query + required: true + schema: + description: Model name to get metrics for + type: string + responses: + "200": + description: Queue metrics + content: + application/json: + schema: + $ref: "#/components/schemas/QueueMetricsResponse" + "400": + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + summary: Get queue metrics + tags: + - Queue + /queue/status: + get: + description: Poll the current status of a previously submitted job. Provide the request_id and model as query parameters. + operationId: getQueueJobStatus + parameters: + - name: request_id + in: query + required: true + schema: + description: Request ID returned from the submit endpoint + type: string + - name: model + in: query + required: true + schema: + description: Model name the job was submitted to + type: string + responses: + "200": + description: Status information + content: + application/json: + schema: + $ref: "#/components/schemas/QueueJobStatusResponse" + "400": + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "404": + description: Request not found + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + summary: Get job status + tags: + - Queue + /queue/submit: + post: + description: | + Submit a new job to the queue for asynchronous processing. Jobs are + processed in strict priority order (higher priority first, FIFO within + the same priority). Returns a request ID that can be used to poll status + or cancel the job. + operationId: submitQueueJob + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/QueueJobRequest" + description: Job request + required: true + responses: + "200": + description: Successfully queued request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueJobResponse" + "400": + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/QueueError" + summary: Submit a queued job + tags: + - Queue + /rl/model-resources: + get: + summary: List model resources + description: Lists the caller's model resources. + operationId: listModelResources + tags: [RL] + responses: + "200": + description: List of model resources + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ModelResourcesListResponse' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: status + in: query + required: false + schema: + description: Status filters. When omitted, resources in any status are returned. + type: array + items: + type: string + enum: + - MODEL_RESOURCES_STATUS_PENDING + - MODEL_RESOURCES_STATUS_CREATING + - MODEL_RESOURCES_STATUS_READY + - MODEL_RESOURCES_STATUS_ERROR + - MODEL_RESOURCES_STATUS_STOPPED + - MODEL_RESOURCES_STATUS_STOPPING + - name: limit + in: query + required: false + schema: + description: Maximum number of resources to return (1-100) + type: integer + default: "20" + - name: after + in: query + required: false + schema: + description: Cursor for pagination + type: string + - name: created_by + in: query + required: false + schema: + description: Filter resources in the current project by the creator ID. Pass "me" to show resources you created. + type: string + post: + summary: Create model resources + description: Provisions a standalone model resource that training sessions can attach to. + operationId: createModelResources + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CreateModelResourcesRequest' + required: true + responses: + "200": + description: Model resource details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ModelResources' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /rl/model-resources/estimate-cost: + post: + summary: Estimate on-demand model resource cost + description: Estimates a model resource's on-demand hourly price without creating it. + operationId: estimateModelResourcesCost + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CreateModelResourcesRequest' + required: true + responses: + "200": + description: Estimated on-demand cost + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ModelResourcesEstimateCostResponse' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /rl/model-resources/{model_resources_id}: + get: + summary: Get model resources + description: Gets a model resource by its ID and returns its details. + operationId: getModelResources + tags: [RL] + responses: + "200": + description: Model resource details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ModelResources' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: model_resources_id + in: path + required: true + schema: + description: ID of the model resource + type: string + /rl/model-resources/{model_resources_id}/stop: + post: + summary: Stop model resources + description: Stops every session attached to the resource and tears down its GPU pods. + operationId: stopModelResources + tags: [RL] + responses: + "200": + description: Model resource details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ModelResources' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: model_resources_id + in: path + required: true + schema: + description: ID of the model resource + type: string + - name: force + in: query + required: false + schema: + description: Stop the resource even if active training sessions are attached + type: boolean + default: false + /rl/training-sessions: + get: + summary: List training sessions + description: Lists all training sessions. + operationId: listTrainingSessions + tags: [RL] + responses: + "200": + description: List of training sessions + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingSessionsListResponse' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: status + in: query + required: false + schema: + description: Status filters. When omitted, sessions in any status are returned. + type: array + items: + type: string + enum: + - TRAINING_SESSION_STATUS_CREATING + - TRAINING_SESSION_STATUS_RUNNING + - TRAINING_SESSION_STATUS_STOPPED + - TRAINING_SESSION_STATUS_STOPPING + - TRAINING_SESSION_STATUS_ERROR + - TRAINING_SESSION_STATUS_EXPIRED + - name: limit + in: query + required: false + schema: + description: Maximum number of sessions to return (1-100) + type: integer + default: "20" + - name: after + in: query + required: false + schema: + description: Cursor for pagination (ID of the last session from the previous page) + type: string + - name: model_resources_id + in: query + required: false + schema: + description: Filter sessions by the model resource they are attached to + type: string + - name: created_by + in: query + required: false + schema: + description: Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. + type: string + post: + summary: Create training session + description: Creates a training session and returns its details. + operationId: startTrainingSession + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.StartTrainingSessionRequest' + required: true + responses: + "200": + description: Training session details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingSession' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /rl/supported-models: + get: + summary: List supported models + description: Returns the models supported by the RL service and their limits for training/sampling operations. + operationId: listSupportedModels + tags: [RL] + responses: + "200": + description: List of supported RL models + content: + application/json: + schema: + $ref: '#/components/schemas/RL.SupportedModelsListResponse' + "429": + description: Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + /rl/training-sessions/{session_id}: + get: + summary: Get training session + description: Gets a training session by its ID and returns its details. + operationId: getTrainingSession + tags: [RL] + responses: + "200": + description: Training session details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingSession' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: ID of the training session + type: string + /rl/training-sessions/{session_id}/stop: + post: + summary: Stop training session + description: Stops a training session. + operationId: stopTrainingSession + tags: [RL] + responses: + "200": + description: Training session details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingSession' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: ID of the training session + type: string + /rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}: + get: + summary: Get forward-backward operation + description: Retrieves the current status and result of a forward-backward operation. + operationId: getForwardBackwardOperation + tags: [RL] + responses: + "200": + description: Forward-backward operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardBackwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/optim-step/{operation_id}: + get: + summary: Get optim-step operation + description: Retrieves the current status and result of an optim-step operation. + operationId: getOptimStepOperation + tags: [RL] + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.OptimStepOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/sample/{operation_id}: + get: + summary: Get sample operation + description: Retrieves the current status and result of a sample operation. + operationId: GetSample + tags: [RL] + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.SampleOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/forward-backward: + post: + summary: Forward-backward pass + description: Submits a forward-backward pass operation that will asynchronously compute gradients via backpropagation. + operationId: forwardBackward + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardBackwardBody' + required: true + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardBackwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/custom-forward-backward: + post: + summary: Custom forward-backward pass + description: Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. + operationId: customForwardBackward + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CustomForwardBackwardBody' + required: true + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CustomForwardBackwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/custom-forward-backward/{operation_id}: + get: + summary: Get custom forward-backward operation + description: Retrieves the current status and result of a custom forward-backward operation. + operationId: getCustomForwardBackwardOperation + tags: [RL] + responses: + "200": + description: Custom forward-backward operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CustomForwardBackwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/forward: + post: + summary: Forward pass + description: Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample. + operationId: forward + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardBody' + required: true + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/forward/{operation_id}: + get: + summary: Get forward operation + description: Retrieves the current status and result of a forward operation. + operationId: getForwardOperation + tags: [RL] + responses: + "200": + description: Forward operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.ForwardOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/optim-step: + post: + summary: Optimizer step + description: Submits an optimizer step operation that will asynchronously apply accumulated gradients to update model parameters. + operationId: OptimStep + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.OptimStepBody' + required: true + responses: + "200": + description: Optimizer step operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.OptimStepOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/sample: + post: + summary: Sample + description: Submits a sample operation that will asynchronously generate text completions with logprobs. + operationId: Sample + tags: [RL] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RL.SampleBody' + required: true + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RL.SampleOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/inference-checkpoint: + post: + summary: Create inference checkpoint + description: Submits an operation that will asynchronously save the current LoRA adapter as an inference checkpoint and upload it to object storage. + operationId: createInferenceCheckpoint + tags: [RL] + responses: + "200": + description: Inference checkpoint operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.InferenceCheckpointOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/inference-checkpoint/{operation_id}: + get: + summary: Get inference checkpoint operation + description: Retrieves the current status and result of an inference checkpoint operation. + operationId: getInferenceCheckpointOperation + tags: [RL] + responses: + "200": + description: Inference checkpoint operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.InferenceCheckpointOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/training-sessions/{session_id}/operations/training-checkpoint: + post: + summary: Save training checkpoint + description: Submits an operation that will asynchronously save the full training state (adapter + optimizer + step). + operationId: createTrainingCheckpoint + tags: [RL] + responses: + "200": + description: Save training checkpoint operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingCheckpointOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + /rl/training-sessions/{session_id}/operations/training-checkpoint/{operation_id}: + get: + summary: Get save training checkpoint operation + description: Retrieves the current status and result of a save training checkpoint operation. + operationId: getTrainingCheckpointOperation + tags: [RL] + responses: + "200": + description: Save training checkpoint operation details + content: + application/json: + schema: + $ref: '#/components/schemas/RL.TrainingCheckpointOperation' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: session_id + in: path + required: true + schema: + description: Training session ID + type: string + - name: operation_id + in: path + required: true + schema: + description: Operation ID + type: string + /rl/checkpoints/{id}/download: + get: + summary: Download checkpoint + description: Returns presigned URLs for downloading a checkpoint's model files. Only inference checkpoints support downloading. + operationId: downloadCheckpoint + tags: [RL] + responses: + "200": + description: Checkpoint download URLs + content: + application/json: + schema: + $ref: '#/components/schemas/RL.CheckpointDownloadResponse' + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + parameters: + - name: id + in: path + required: true + schema: + description: ID of the checkpoint + type: string + - name: variant + in: query + required: true + schema: + description: "Checkpoint variant to download: merged (full model) or adapter (LoRA weights only)" + $ref: '#/components/schemas/RL.CheckpointVariant' + + /compute/clusters/{cluster_id}/addons: + get: + tags: ['InstanceClusterAddOnService'] + operationId: InstanceClusterAddOnService_List + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster whose add-ons to list. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterAddOnsListResponse' + post: + tags: ['InstanceClusterAddOnService'] + operationId: InstanceClusterAddOnService_Create + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster to create the add-on on. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterAddOnCreateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AddOnInfo' + /compute/clusters/{cluster_id}/addons/{addon_id}: + get: + tags: ['InstanceClusterAddOnService'] + operationId: InstanceClusterAddOnService_Get + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster that owns the add-on. + type: string + - name: addon_id + in: path + required: true + schema: + description: The ID of the add-on to retrieve. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AddOnInfo' + put: + tags: ['InstanceClusterAddOnService'] + operationId: InstanceClusterAddOnService_Update + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster that owns the add-on. + type: string + - name: addon_id + in: path + required: true + schema: + description: The ID of the add-on to update. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterAddOnUpdateRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AddOnInfo' + delete: + tags: ['InstanceClusterAddOnService'] + operationId: InstanceClusterAddOnService_Delete + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The ID of the cluster that owns the add-on. + type: string + - name: addon_id + in: path + required: true + schema: + description: The ID of the add-on to delete. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterAddOnDeleteResponse' + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations: + get: + tags: ['RemediationService'] + summary: List remediations + description: | + Lists remediations for an instance or cluster. + operationId: RemediationService_ListRemediations + parameters: + - name: cluster_id + in: path + required: true + schema: + type: string + - name: instance_id + in: path + required: true + schema: + description: | + To list remediations on a specific node, pass the node's instance ID. + To list remediations for all nodes in a cluster, pass `-` as a wildcard for the instance ID. + type: string + - name: page_size + in: query + schema: + description: Maximum results to return. + type: integer + - name: page_token + in: query + schema: + description: Pagination token from previous request. + type: string + - name: state + in: query + schema: + description: |- + Filter by state(s). Returns remediations matching any of the specified states. + + - `PENDING_APPROVAL`: Awaiting approval before processing can begin. + - `PENDING`: Approved and queued for processing. + - `RUNNING`: Actively being processed. + - `SUCCEEDED`: Successfully completed. + - `FAILED`: Failed with an error. + - `CANCELLED`: Cancelled by user or system. + - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + - `QUARANTINING`: Cordoning or preparing the host before remediation. + - `QUARANTINED`: Host has been cordoned or isolated for remediation. + type: array + items: + enum: + - PENDING_APPROVAL + - PENDING + - RUNNING + - SUCCEEDED + - FAILED + - CANCELLED + - AUTO_RESOLVED + - QUARANTINING + - QUARANTINED + type: string + - name: order_by + in: query + schema: + description: Order by expression. + type: string + - name: trigger + in: query + schema: + description: Filter by trigger type(s). Returns remediations matching any of the specified triggers. + type: array + items: + enum: + - REMEDIATION_TRIGGER_MANUAL + - REMEDIATION_TRIGGER_AUTOMATED + type: string + - name: mode + in: query + schema: + description: Filter by remediation mode(s). Returns remediations matching any of the specified modes. + type: array + items: + enum: + - REMEDIATION_MODE_VM_ONLY + - REMEDIATION_MODE_HOST_AWARE + - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT + - REMEDIATION_MODE_REBOOT_VM + - REMEDIATION_MODE_HOST_POWER_CYCLE + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListRemediationsResponse' + post: + tags: ['RemediationService'] + description: |- + Creates a new remediation for an instance. + + Remediations created via the API goes directly to PENDING state. + + Our system may trigger automated remediations that require approval. These remediations are created with PENDING_APPROVAL state. + The user must call /approve to start the actual remediation process. + These operations can also be rejected by calling /reject. + operationId: RemediationService_CreateRemediation + parameters: + - name: cluster_id + in: path + required: true + schema: + type: string + - name: instance_id + in: path + required: true + schema: + type: string + - name: remediation_id + in: query + schema: + description: Client-specified ID for idempotency. + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}: + get: + tags: ['RemediationService'] + description: Retrieve the status of a specific remdiation on a specific instance in a specific cluster. + operationId: RemediationService_GetRemediation + parameters: + - name: cluster_id + in: path + required: true + schema: + type: string + - name: instance_id + in: path + required: true + schema: + type: string + - name: remediation_id + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/approve: + post: + tags: ['RemediationService'] + description: | + Approves a pending remediation. + + Only remediations with state PENDING_APPROVAL can be approved. + + On APPROVE: state changes to PENDING and the remediation process begins. + The reviewed_by, review_time, and review_comment fields are populated + on the remediation after approval. + operationId: RemediationService_ApproveRemediation + parameters: + - name: cluster_id + in: path + required: true + schema: + type: string + - name: instance_id + in: path + required: true + schema: + type: string + - name: remediation_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApproveRemediationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/cancel: + post: + tags: ['RemediationService'] + description: | + Cancels a pending remediation. + + Only remediations in PENDING_APPROVAL or PENDING state can be cancelled. + operationId: RemediationService_CancelRemediation + parameters: + - name: cluster_id + in: path + required: true + schema: + description: The cluster ID. + type: string + - name: instance_id + in: path + required: true + schema: + description: The instance ID. + type: string + - name: remediation_id + in: path + required: true + schema: + description: The remediation ID. + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/reject: + post: + tags: ['RemediationService'] + description: | + Rejects a pending remediation. + + Only remediations with state PENDING_APPROVAL can be rejected. + + On REJECT: state changes to CANCELLED. + The reviewed_by, review_time, and review_comment fields are populated + on the remediation after rejection. + operationId: RemediationService_RejectRemediation + parameters: + - name: cluster_id + in: path + required: true + schema: + type: string + - name: instance_id + in: path + required: true + schema: + type: string + - name: remediation_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommentBody' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Remediation' + /compute/passive_health_check_alerts: + get: + tags: ['HealthCheckService'] + summary: List passive health check alerts + description: |- + Lists passive health check alerts. Filters combine across axes; empty values skip that axis. + operationId: HealthCheckService_ListPassiveHealthCheckAlerts + parameters: + - name: intent_id + in: query + schema: + description: Remediation intent ID to filter by. + type: string + - name: instance_id + in: query + schema: + description: Instance ID to filter by. + type: string + - name: cluster_id + in: query + schema: + description: Optional instance cluster ID to filter by. Required for non-admin callers. + type: string + - name: page_size + in: query + schema: + description: Max number of results to return. + default: 50 + type: integer + - name: page_token + in: query + schema: + description: Opaque pagination token from the previous response. + type: string + - name: status + in: query + schema: + description: Lifecycle filter. Omit to return firing alerts. + enum: + - PHC_ALERT_STATUS_FIRING + - PHC_ALERT_STATUS_RESOLVED + - PHC_ALERT_STATUS_ALL + type: string + - name: severity_filter + in: query + schema: + description: Severity tiers to include. Omit or pass an empty array to include all severities. + type: array + items: + enum: + - PHC_SEVERITY_INFO + - PHC_SEVERITY_WARNING + - PHC_SEVERITY_CRITICAL + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListPassiveHealthCheckAlertsResponse' + /whoami: + get: + tags: ['Account'] + summary: Get API key identity + description: > + Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`/`) in dedicated endpoint inference calls. + + Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. + operationId: whoami + x-codeSamples: + - lang: Python + label: Together AI SDK (v2) + source: | + from together import Together + + client = Together() + identity = client.whoami() + print(identity) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const identity = await client.whoami(); + console.log(identity); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const identity = await client.whoami(); + console.log(identity); + - lang: Shell + label: cURL + source: | + curl https://api.together.ai/v1/whoami \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + responses: + '200': + description: API key identity information + content: + application/json: + schema: + $ref: '#/components/schemas/WhoamiResponse' + '401': + description: Unauthorized — missing or invalid API key + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + x-bearer-format: bearer + x-default: default + + schemas: + DE.ListPublicEndpointsResponse: + type: object + description: Response containing publicly discoverable endpoints and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.PublicEndpoint' + description: Endpoints visible through the public catalog. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.PublicEndpoint: + type: object + description: Endpoint metadata exposed through the public endpoint catalog. + required: + - id + - projectId + - name + - createdAt + - updatedAt + - visibility + properties: + id: + type: string + description: Unique endpoint identifier. + projectId: + type: string + description: ID of the project that owns the endpoint. + name: + type: string + description: Endpoint string in the form `/`, passed as the `model` parameter when calling inference. + createdAt: + type: string + format: date-time + description: Timestamp when the endpoint was created. + updatedAt: + type: string + format: date-time + description: Timestamp when the endpoint was last updated. + visibility: + const: VISIBILITY_PUBLIC + type: string + description: Public visibility of the endpoint. + DE.ListEndpointsResponse: + type: object + description: Response containing endpoints and pagination metadata. + required: + - data + - object + properties: + data: + description: The list of endpoints. + type: array + items: + $ref: '#/components/schemas/DE.Endpoint' + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.Endpoint: + description: Stable inference entry point that groups deployments and routes requests among them. + type: object + required: + - name + - id + - projectId + - createdAt + - updatedAt + - etag + - deployments + - trafficSplit + - visibility + - endpointType + properties: + id: + readOnly: true + description: Unique endpoint identifier. + type: string + projectId: + readOnly: true + type: string + description: ID of the project that owns the endpoint. + name: + type: string + description: |- + Project-qualified endpoint name in the form `/`. + Pass this value as `model` in inference requests. Create and update requests + may use either a bare endpoint name or the qualified form; a supplied project + slug must match the project in the request path. + createdAt: + readOnly: true + type: string + description: Timestamp when the endpoint was created. + format: date-time + updatedAt: + type: string + description: Output only. Timestamp when the endpoint was last updated. + format: date-time + etag: + type: string + description: |- + Opaque version tag for optimistic concurrency control. + Supply on update/delete to ensure consistent read-modify-write. + If not set, the write overwrites based on current state. + trafficSplit: + type: array + items: + $ref: '#/components/schemas/DE.TrafficSplitEntry' + description: Deployments eligible for live traffic and their capacity weights. An empty list leaves the endpoint unrouted. + visibility: + default: VISIBILITY_PRIVATE + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization. + endpointType: + readOnly: true + enum: + - ENDPOINT_TYPE_DEDICATED + - ENDPOINT_TYPE_SERVERLESS + type: string + description: Serving class of the endpoint. + deployments: + type: array + readOnly: true + items: + $ref: '#/components/schemas/DE.DeploymentSummary' + description: |- + Lightweight summaries of deployments under this endpoint. + Retrieve a deployment through the endpoint's deployment API for full details. + activeRolloutId: + readOnly: true + type: string + description: ID of the currently active rollout, or empty if none. + DE.DeploymentSummary: + type: object + description: Compact deployment status embedded in an endpoint response. + required: + - id + - autoscaling + - createdAt + - model + - modelId + - name + - state + - trafficMode + - estimatedEffectiveTrafficShare + properties: + id: + readOnly: true + type: string + description: Deployment identifier. + modelId: + type: string + description: Deprecated. Use `model`. Model identifier being served. + hardware: + readOnly: true + type: string + description: Hardware configuration selected by the deployment's config, such as its GPU type and count. + trafficMode: + enum: + - TRAFFIC_MODE_LIVE + - TRAFFIC_MODE_SHADOW + type: string + description: Whether the deployment serves client-visible responses or only mirrored shadow traffic. + state: + readOnly: true + enum: + - DEPLOYMENT_STATE_PROVISIONING + - DEPLOYMENT_STATE_READY + - DEPLOYMENT_STATE_SCALING + - DEPLOYMENT_STATE_DEGRADED + - DEPLOYMENT_STATE_FAILED + - DEPLOYMENT_STATE_STOPPED + - DEPLOYMENT_STATE_STOPPING + type: string + description: Current state of the deployment. + name: + readOnly: true + type: string + description: |- + Inference-addressable name in the fully-qualified form + "//". Pass it as the + "model" field when calling the inference API to pin to this deployment. + createdAt: + readOnly: true + type: string + description: Timestamp when the deployment was created. + format: date-time + autoscaling: + readOnly: true + allOf: + - $ref: '#/components/schemas/DE.AutoscalingResponse' + description: Autoscaling configuration for the deployment. + desiredReplicas: + readOnly: true + type: integer + description: |- + Number of replicas the autoscaler currently wants across all regions. + readyReplicas: + readOnly: true + type: integer + description: |- + Number of replicas currently ready to serve requests across all regions. + model: + type: string + description: |- + Resource name of the served model in the form + `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. + For public models, the model's owning project may differ from the deployment's project. + estimatedEffectiveTrafficShare: + readOnly: true + type: number + format: double + description: Estimated fraction from 0 to 1 of endpoint traffic currently routed to this deployment. + DE.TrafficSplitEntry: + type: object + description: Capacity weight assigned to one deployment in an endpoint's live traffic split. + required: + - deploymentId + - weight + properties: + deploymentId: + type: string + description: ID of a deployment under the endpoint that can receive live traffic. + weight: + type: number + description: |- + Non-negative, finite weight applied to each ready replica. A deployment's + effective routing capacity is `weight * readyReplicas`, and requests are + distributed in proportion to that capacity. Set to `0` to remove the + deployment from the live traffic split. + DE.CreateEndpointRequest: + type: object + description: Request parameters for creating an endpoint. + required: + - name + properties: + name: + type: string + description: Inference-addressable endpoint name to create. + visibility: + default: VISIBILITY_PRIVATE + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization. + DE.EndpointUpdate: + type: object + description: Mutable endpoint fields for update requests. + properties: + name: + type: string + description: Updated endpoint string. + etag: + type: string + description: Current endpoint version. The update is rejected if this value no longer matches. + trafficSplit: + type: array + description: Replacement live traffic split. Use an empty list to stop routing live traffic. + items: + $ref: '#/components/schemas/DE.TrafficSplitEntry' + visibility: + default: VISIBILITY_PRIVATE + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization. + DE.CreateDeploymentRequest: + type: object + description: Configuration for creating a deployment that binds a model and immutable config to an endpoint. + required: + - name + - autoscaling + properties: + name: + type: string + description: Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string. + modelId: + type: string + description: Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset. + modelRevisionId: + type: string + description: Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation. + configId: + type: string + description: Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset. + model: + type: string + description: Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time. + autoscaling: + allOf: + - $ref: '#/components/schemas/DE.Autoscaling' + description: Autoscaling configuration for the deployment. + config: + type: string + description: Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model. + enableLora: + type: boolean + description: Enables dynamic loading of LoRA adapters on the deployment. + placement: + allOf: + - $ref: '#/components/schemas/DE.Placement' + description: Placement policy to use when scheduling the deployment. + DE.UpdateDeploymentRequest: + type: object + description: Mutable deployment settings. Use the resource-name fields or their deprecated ID alternatives for a model or config change, but not both. + properties: + name: + type: string + description: Updated endpoint string. + autoscaling: + allOf: + - $ref: '#/components/schemas/DE.Autoscaling' + description: Updated autoscaling configuration. + etag: + type: string + description: Current deployment version. The update is rejected if this value no longer matches. + DE.CreateABExperimentRequest: + type: object + description: Configuration for a managed live-traffic split across deployments under one endpoint. + required: + - name + - members + properties: + name: + type: string + description: Human-readable A/B experiment name, unique within the endpoint. + description: + type: string + description: Optional free-form description. + members: + type: array + items: + $ref: '#/components/schemas/DE.ABExperimentMember' + description: Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100. + DE.UpdateABExperimentRequest: + type: object + description: Mutable description and traffic allocation for an A/B experiment. + properties: + description: + type: string + description: Updated free-form description. + members: + type: array + items: + $ref: '#/components/schemas/DE.ABExperimentMember' + description: Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100. + etag: + type: string + description: Opaque version tag from a prior read for optimistic concurrency. + DE.CreateRemoteUploadSpec: + description: Request parameters for creating a remote upload. + type: object + required: + - modelId + - remoteUrl + properties: + modelId: + type: string + description: ID of the registered model that will receive the imported files. + remoteUrl: + type: string + description: Hugging Face repository URL or presigned archive URL to import. + token: + type: string + description: Optional source credential used to access a private remote location. The value is write-only and is not returned. + DE.ListFilesResponse: + type: object + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ListFilesResponseFile' + description: Files in the selected model revision. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + revisionId: + type: string + description: ID of the model revision whose files are listed. + revisionCreatedAt: + type: string + format: date-time + description: Time when the listed model revision was created. + totalSizeBytes: + type: string + description: Total size of all files in the revision, in bytes. + description: Files and aggregate size information for one model revision. + DE.DeleteResponse: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Empty response returned after a successful delete operation. + DE.ListEndpointAccessResponse: + type: object + properties: + entries: + type: array + items: + $ref: '#/components/schemas/DE.AccessEntry' + description: All principals currently granted access on the endpoint. + description: Principals currently allowed to send inference requests to an endpoint. + DE.ListInferenceInstanceTypesResponse: + type: object + description: Hardware instance types available for inference deployments. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.InferenceInstanceType' + description: Instance types available for inference. + next_cursor: + type: string + description: Cursor for the next page. Always null today because this catalog is returned in full. + object: + const: list + description: Object type. Always `list`. + DE.RevokeEndpointAccessResponse: + type: object + properties: {} + description: Empty response returned after an endpoint access grant is revoked or confirmed absent. + DE.ListRemoteUploadsResponse: + type: object + description: Remote model import jobs and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.RemoteUpload' + description: Remote upload jobs. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListPlacementProfilesResponse: + type: object + description: Reusable deployment placement profiles visible to the project. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.PlacementProfile' + description: Placement profiles visible in the project. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.PlacementProfile: + type: object + required: + - id + - projectId + - organizationId + - name + - preferredRegions + properties: + id: + type: string + description: Unique placement profile identifier. + projectId: + type: string + description: Project that owns the placement profile. + organizationId: + type: string + description: Organization that owns the placement profile. + name: + type: string + description: Human-readable placement profile name. + preferredRegions: + type: array + items: + type: string + description: Preferred deployment regions in descending priority order. + description: Reusable ordered region preferences for scheduling a project's deployments. + DE.ListRemoteUploadEventsResponse: + type: object + description: Status and diagnostic events for a remote model import job. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.RemoteUploadEvent' + description: Events for the remote upload. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.RevokeEndpointAccessRequest: + type: object + properties: + principalType: + type: string + description: Type of principal to revoke. Supported values are `project`, `api_key`, and `organization`. + principalId: + type: string + description: Identifier of the principal whose access is being revoked. + description: Principal whose permission to call the endpoint should be revoked. + required: + - projectId + - id + - principalType + - principalId + DE.GrantEndpointAccessRequest: + type: object + properties: + principalType: + type: string + description: Type of principal to grant. Supported values are `project`, `api_key`, and `organization`. + principalId: + type: string + description: Identifier of the principal to grant access to. + description: Principal that should be allowed to send inference requests to the endpoint. + required: + - projectId + - id + - principalType + - principalId + DE.Deployment: + description: Serving workload that binds a model and immutable config to an endpoint and manages its replicas. + type: object + required: + - id + - projectId + - endpointId + - name + - createdAt + - updatedAt + - modelId + - modelRevisionId + - model + - autoscaling + - configId + - config + - etag + - hardware + - trafficMode + - status + properties: + id: + readOnly: true + type: string + description: Unique deployment identifier. + projectId: + readOnly: true + type: string + description: ID of the project that owns the deployment. + endpointId: + type: string + description: ID of the endpoint that contains the deployment. + name: + type: string + description: Project- and endpoint-qualified deployment name in the form `//`. Pass it as `model` in an inference request to target this deployment directly instead of using the endpoint's traffic split. + createdAt: + readOnly: true + type: string + description: Timestamp when the deployment was created. + format: date-time + updatedAt: + readOnly: true + type: string + description: Timestamp when the deployment was last updated. + format: date-time + modelId: + type: string + description: Deprecated. Use `model`. Model identifier being served, populated during migration. + modelRevisionId: + type: string + description: Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a specific model revision. + model: + type: string + description: Pinned model resource in the form `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. + autoscaling: + allOf: + - $ref: '#/components/schemas/DE.AutoscalingResponse' + description: Replica bounds, timing windows, and metrics that control horizontal scaling. + configId: + type: string + description: Deprecated. Use `config`. Config revision identifier, populated during migration. + config: + type: string + description: Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. + speculatorId: + readOnly: true + type: string + description: Deprecated. Use `speculator`. Speculative decoding model identifier derived from the deployment config. + speculatorRevisionId: + readOnly: true + type: string + description: Deprecated. Use `speculator`. ID of the speculative decoding draft-model revision pinned at creation time. + speculator: + readOnly: true + type: string + description: Pinned draft-model resource used for speculative decoding, in the same form as `model`. Omitted when speculative decoding is disabled. + estimatedEffectiveTrafficShare: + readOnly: true + type: number + format: double + description: Estimated fraction in [0, 1] of endpoint traffic that reaches this deployment under the current routing configuration. Absent or unrouted deployments are 0. + enableLora: + type: boolean + description: Whether the deployment can dynamically load LoRA adapters. + etag: + type: string + description: Opaque version tag for optimistic concurrency control. Supply on update/delete to ensure consistent read-modify-write. If not set, the write overwrites based on current state. + hardware: + readOnly: true + type: string + description: Hardware selected by the deployment config, including GPU type and count. + trafficMode: + readOnly: true + enum: + - TRAFFIC_MODE_LIVE + - TRAFFIC_MODE_SHADOW + type: string + description: Whether the deployment serves client-visible responses or only mirrored shadow traffic. + runtimeInfo: + readOnly: true + allOf: + - $ref: '#/components/schemas/DE.RuntimeInfo' + description: Serving engine and feature support derived from the immutable config. + desiredReplicas: + readOnly: true + type: integer + description: Number of replicas the autoscaler currently wants across all regions. + status: + readOnly: true + allOf: + - $ref: '#/components/schemas/DE.DeploymentStatus' + description: Current lifecycle state and observed replica counts. + placement: + allOf: + - $ref: '#/components/schemas/DE.Placement' + description: Region constraints used to schedule the deployment's replicas. + DE.AdapterEntry: + type: object + description: Adapter attached to a deployment with desired revision and observed load state. + required: + - adapterModelId + - desiredRevisionId + - perCluster + - etag + properties: + adapterModelId: + type: string + description: Adapter model identifier attached to the deployment. + desiredRevisionId: + type: string + description: Adapter revision pinned on the deployment. + perCluster: + type: array + items: + $ref: '#/components/schemas/DE.DeploymentAdapterStatus' + description: Per-cluster adapter load state reported by the controller. + etag: + type: string + description: Row-level etag required for UpdateAdapter and RemoveAdapter. + adapterModel: + type: string + description: Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + desiredRevision: + type: string + description: Resource name of the adapter model revision pinned on the deployment, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + DE.DeploymentAdapterStatus: + type: object + description: Controller-reported load state for an adapter on one deployment cluster. + required: + - adapterModelId + - clusterId + - state + - readyPodCount + - failedPodCount + - totalPodCount + properties: + adapterModelId: + type: string + description: Adapter model identifier for this status row. + clusterId: + type: string + description: Cluster reporting this adapter status. + realizedRevisionId: + type: string + description: Adapter revision currently loaded on pods in this cluster. + realizedEtag: + type: string + description: Adapter row etag observed by the controller when it wrote this status. + state: + enum: + - ADAPTER_LOAD_STATE_PENDING + - ADAPTER_LOAD_STATE_LOADING + - ADAPTER_LOAD_STATE_READY + - ADAPTER_LOAD_STATE_REMOVING + - ADAPTER_LOAD_STATE_FAILED + type: string + description: Current adapter load state in this cluster. + reason: + type: string + description: Stable reason code for the current adapter state. + message: + type: string + description: Human-readable details about the current adapter state. + readyPodCount: + type: integer + description: Number of pods with the adapter ready to serve. + failedPodCount: + type: integer + description: Number of pods that failed to load the adapter. + totalPodCount: + type: integer + description: Total pods expected to report adapter load state. + loadedAt: + type: string + description: Time when the adapter first reached READY in this cluster. + format: date-time + updatedAt: + type: string + description: Time when this adapter status was last updated. + format: date-time + adapterModel: + type: string + description: Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. + realizedRevision: + type: string + description: Resource name of the adapter model revision currently loaded in this cluster, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. + DE.ListAdaptersResponse: + type: object + description: Response containing attached adapters and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.AdapterEntry' + description: Adapters attached to the deployment. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.AddAdapterRequest: + type: object + description: Configuration for attaching a LoRA adapter to a deployment that has adapter loading enabled. + required: + - adapterModelId + properties: + adapterModelId: + type: string + description: Adapter model identifier to attach. + adapterRevisionId: + type: string + description: Optional adapter revision to pin. If omitted, the latest revision is resolved at request time. + force: + type: boolean + description: Whether to evict the oldest adapter if the deployment is at adapter capacity. + DE.UpdateAdapterRequest: + type: object + description: Request body for updating an adapter. + required: + - adapterRevisionId + - etag + properties: + adapterRevisionId: + type: string + description: New adapter revision to pin. + etag: + type: string + description: Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response. + DE.ListRolloutsResponse: + type: object + description: Response containing rollout resources and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.Rollout' + description: Rollouts under the endpoint. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.CreateRolloutRequest: + type: object + description: Strategy, metric gates, timing, and cleanup policy for shifting traffic between two deployments under one endpoint. + required: + - sourceDeploymentId + - targetDeploymentId + oneOf: + - x-stainless-variantName: Canary + required: + - canary + - x-stainless-variantName: BlueGreen + required: + - blueGreen + - x-stainless-variantName: Rolling + required: + - rolling + properties: + sourceDeploymentId: + type: string + description: Deployment that traffic shifts away from. + targetDeploymentId: + type: string + description: Deployment that traffic shifts toward. + canary: + allOf: + - $ref: '#/components/schemas/DE.CanaryConfig' + description: Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling. + blueGreen: + allOf: + - $ref: '#/components/schemas/DE.BlueGreenConfig' + description: Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling. + rolling: + allOf: + - $ref: '#/components/schemas/DE.RollingConfig' + description: Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen. + metrics: + type: array + items: + $ref: '#/components/schemas/DE.MetricRule' + description: Optional metric gates evaluated after each step's soak. + stabilizationWindow: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Optional per-step soak duration before the metric gate runs. + sourceCleanup: + enum: + - SOURCE_CLEANUP_POLICY_DRAIN + - SOURCE_CLEANUP_POLICY_KEEP + type: string + description: Optional policy for the source deployment after completion. + finalSourceReplicas: + type: integer + description: Optional final replica count for the source deployment after completion. + finalTargetReplicas: + type: integer + description: Optional final replica count for the target deployment after completion. + DE.BlueGreenConfig: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Blue-green strategy configuration for a single cutover to the target deployment. + DE.RollingConfig: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Rolling strategy configuration for capacity-preserving batches that ramp target replicas up while draining source replicas. + DE.CanaryConfig: + type: object + description: Canary strategy configuration for gradual traffic progression. + required: + - steps + properties: + steps: + type: array + items: + $ref: '#/components/schemas/DE.RolloutStep' + description: Required progression steps. The final step must send 100 percent traffic to the target. + stepInterval: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Optional interval between steps. Defaults to 10m if omitted. + DE.RolloutStep: + type: object + description: One stage of a canary rollout progression. + required: + - traffic + properties: + traffic: + type: integer + description: Required percentage of traffic on the target deployment for this step. + replicas: + type: integer + description: Optional explicit target replica count for this step. + DE.MetricRule: + type: object + description: Metric gate evaluated during a rollout. + required: + - name + - stat + oneOf: + - x-stainless-variantName: Threshold + required: + - thresholdCheck + - x-stainless-variantName: Regression + required: + - regressionCheck + properties: + name: + type: string + description: Required metric name as exported to the observability backend. + stat: + enum: + - METRIC_STAT_TYPE_AVG + - METRIC_STAT_TYPE_MIN + - METRIC_STAT_TYPE_MAX + - METRIC_STAT_TYPE_PERCENTILE + type: string + description: Required aggregation used for the metric. + percentile: + type: integer + description: Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + thresholdCheck: + allOf: + - $ref: '#/components/schemas/DE.ThresholdCheck' + description: Threshold evaluation criteria. Mutually exclusive with regressionCheck. + regressionCheck: + allOf: + - $ref: '#/components/schemas/DE.RegressionCheck' + description: Regression evaluation criteria. Mutually exclusive with thresholdCheck. + window: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Optional query window for the metric. Defaults to the step soak duration. + DE.ThresholdCheck: + type: object + description: Threshold criteria that fail when the target metric violates the configured bound. + required: + - value + - operator + properties: + value: + type: number + description: Required numeric threshold value. + operator: + enum: + - THRESHOLD_OPERATOR_GT + - THRESHOLD_OPERATOR_GTE + - THRESHOLD_OPERATOR_LT + - THRESHOLD_OPERATOR_LTE + type: string + description: Required comparison operator applied to the target metric value. + DE.RegressionCheck: + type: object + description: Regression criteria that fail when the target regresses against the source beyond a limit. + required: + - maxRegressionPercent + - direction + properties: + maxRegressionPercent: + type: number + description: Required maximum allowed regression percentage. + direction: + enum: + - REGRESSION_DIRECTION_HIGHER_IS_WORSE + - REGRESSION_DIRECTION_LOWER_IS_WORSE + type: string + description: Required direction that indicates whether higher or lower metric values are worse. + DE.PauseRolloutRequest: + type: object + description: Optional concurrency check and audit reason for pausing a running rollout. + properties: + etag: + type: string + description: Optional etag for optimistic concurrency. + reason: + type: string + description: Optional human-readable reason recorded on the rollout pause metadata. + DE.ResumeRolloutRequest: + type: object + description: Optional concurrency check for resuming a paused rollout. + properties: + etag: + type: string + description: Optional etag for optimistic concurrency. + DE.CancelRolloutRequest: + type: object + description: Reason, disposition, and optional concurrency check for canceling a rollout. + required: + - reason + properties: + reason: + type: string + description: Required human-readable reason recorded in the rollout audit trail. + etag: + type: string + description: Optional etag for optimistic concurrency. + disposition: + enum: + - CANCEL_DISPOSITION_FREEZE + - CANCEL_DISPOSITION_REVERT + type: string + description: Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split; revert sends all traffic back to the source deployment and terminates the rollout. + DE.PromoteRolloutRequest: + type: object + description: Optional concurrency check for immediately completing a rollout on its target deployment. + properties: + etag: + type: string + description: Optional etag for optimistic concurrency. + DE.PauseInfo: + type: object + description: Pause metadata returned while a rollout is paused. + required: + - pausedAt + properties: + reason: + type: string + description: Human-readable reason recorded when the rollout was paused. + pausedAt: + type: string + description: Timestamp when the rollout was paused. + format: date-time + DE.Rollout: + type: object + description: Public view of a rollout resource and its embedded runtime status. + required: + - id + - endpointId + - sourceDeploymentId + - targetDeploymentId + - strategy + - state + - createdAt + - status + properties: + id: + type: string + description: Output only. Unique rollout identifier. + readOnly: true + endpointId: + type: string + description: Output only. Endpoint this rollout belongs to. + readOnly: true + sourceDeploymentId: + type: string + description: Output only. Deployment that traffic is shifting away from. + readOnly: true + targetDeploymentId: + type: string + description: Output only. Deployment that traffic is shifting toward. + readOnly: true + strategy: + enum: + - ROLLOUT_STRATEGY_TYPE_ROLLING + - ROLLOUT_STRATEGY_TYPE_CANARY + - ROLLOUT_STRATEGY_TYPE_BLUE_GREEN + type: string + description: Output only. Rollout strategy selected at creation. + readOnly: true + state: + enum: + - ROLLOUT_STATE_RUNNING + - ROLLOUT_STATE_PAUSED + - ROLLOUT_STATE_STABILIZING + - ROLLOUT_STATE_ABORTING + - ROLLOUT_STATE_COMPLETED + - ROLLOUT_STATE_ABORTED + - ROLLOUT_STATE_PENDING + - ROLLOUT_STATE_SYSTEM_PAUSED + - ROLLOUT_STATE_CANCELLING + - ROLLOUT_STATE_CANCELED + type: string + description: Output only. High-level rollout lifecycle state. + readOnly: true + currentStep: + type: integer + description: Output only. Zero-based index of the current step. Unset while PENDING; step 0 is reported explicitly after start. + readOnly: true + currentTrafficPercent: + type: integer + description: Output only. Applied percentage of traffic on the target deployment. + readOnly: true + createdAt: + type: string + description: Output only. Timestamp when the rollout was created. + format: date-time + readOnly: true + startedAt: + type: string + description: Output only. Timestamp when the rollout started running. + format: date-time + readOnly: true + completedAt: + type: string + description: Output only. Timestamp when the rollout reached a terminal state. + format: date-time + readOnly: true + etag: + type: string + description: Output only. Opaque version tag for optimistic concurrency control. + readOnly: true + status: + allOf: + - $ref: '#/components/schemas/DE.RolloutStatus' + description: Output only. Derived runtime progress and failure details. + readOnly: true + pauseInfo: + allOf: + - $ref: '#/components/schemas/DE.PauseInfo' + description: Output only. Why and when the rollout was paused. Set only while paused or system-paused. + readOnly: true + DE.RolloutStatus: + type: object + description: Derived runtime progress for a rollout. + required: [totalSteps, steps] + properties: + totalSteps: + type: integer + description: Total number of steps in the rollout progression. Always serializes when status is present. + condition: + allOf: + - $ref: '#/components/schemas/DE.RolloutCondition' + description: Failure detail set when the rollout pauses, system-pauses, or aborts. + steps: + type: array + items: + $ref: '#/components/schemas/DE.RolloutStepStatus' + description: Per-step rollout execution summaries. + updatedAt: + type: string + description: Timestamp of the most recent progress update. + format: date-time + DE.RolloutCondition: + type: object + description: Structured reason a rollout stopped progressing. + properties: + category: + enum: + - ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION + - ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE + - ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY + - ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED + - ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION + - ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED + - ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR + - ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE + - ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR + - ROLLOUT_FAILURE_CATEGORY_INTERNAL + - ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE + - ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED + - ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED + type: string + description: Category that classifies why the rollout stopped. + message: + type: string + description: Human-readable explanation for the condition. + atStep: + type: integer + description: Step index where the condition arose. Step 0 serializes explicitly. + observedAt: + type: string + description: Timestamp when the condition was observed. + format: date-time + metrics: + type: array + items: + $ref: '#/components/schemas/DE.MetricResult' + description: Metrics observed at the failing gate, enriched with their criteria. + DE.RolloutStepStatus: + type: object + description: Collapsed execution state for one rollout step. + properties: + stepIndex: + type: integer + description: Index of this step in the rollout progression. Step 0 serializes explicitly. + targetTrafficPercent: + type: integer + description: Target traffic percentage configured for this step. Always serializes for recorded steps. + state: + enum: + - ROLLOUT_STEP_STATE_PENDING + - ROLLOUT_STEP_STATE_RUNNING + - ROLLOUT_STEP_STATE_PASSED + - ROLLOUT_STEP_STATE_FAILED + type: string + description: Execution state of this rollout step. + metrics: + type: array + items: + $ref: '#/components/schemas/DE.MetricResult' + description: Metric gate results for this step. + startedAt: + type: string + description: Timestamp when this step started. + format: date-time + completedAt: + type: string + description: Timestamp when this step completed. + format: date-time + failureReason: + type: string + description: Failure reason when this step failed. + DE.MetricResult: + type: object + description: Observed metric value enriched with its rollout rule and verdict. + properties: + name: + type: string + description: Metric name as exported to the observability backend. + stat: + enum: + - METRIC_STAT_TYPE_AVG + - METRIC_STAT_TYPE_MIN + - METRIC_STAT_TYPE_MAX + - METRIC_STAT_TYPE_PERCENTILE + type: string + description: Aggregation used for the metric. + percentile: + type: integer + description: Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE. + check: + enum: + - METRIC_CHECK_TYPE_THRESHOLD + - METRIC_CHECK_TYPE_REGRESSION + type: string + description: Evaluation form used by the metric rule. + sourceValue: + type: number + description: Observed source baseline. Set only for regression checks; a 0 reading serializes explicitly. + targetValue: + type: number + description: Observed target value. A 0 reading serializes explicitly. + threshold: + type: number + description: Threshold criteria used when check is METRIC_CHECK_TYPE_THRESHOLD. + operator: + enum: + - THRESHOLD_OPERATOR_GT + - THRESHOLD_OPERATOR_GTE + - THRESHOLD_OPERATOR_LT + - THRESHOLD_OPERATOR_LTE + type: string + description: Threshold comparison operator. + maxRegressionPercent: + type: number + description: Regression percentage limit used when check is METRIC_CHECK_TYPE_REGRESSION. + direction: + enum: + - REGRESSION_DIRECTION_HIGHER_IS_WORSE + - REGRESSION_DIRECTION_LOWER_IS_WORSE + type: string + description: Direction that indicates whether higher or lower values are worse. + verdict: + enum: + - METRIC_VERDICT_PASS + - METRIC_VERDICT_BREACHED + - METRIC_VERDICT_UNAVAILABLE + type: string + description: Result of evaluating this metric at the gate. + DE.ABExperiment: + type: object + required: + - name + - members + - id + - projectId + - endpointId + - createdAt + - createdBy + - updatedAt + - etag + properties: + id: + type: string + description: Output only. Unique A/B experiment identifier. + projectId: + type: string + description: Output only. Project that owns the parent endpoint. + endpointId: + type: string + description: Output only. Endpoint this A/B experiment belongs to. + name: + type: string + description: Human-readable A/B experiment name, unique within the endpoint. + description: + type: string + description: Optional free-form description. + members: + type: array + items: + $ref: '#/components/schemas/DE.ABExperimentMember' + description: Two to 20 participating deployments with exactly one control and percentages that add up to 100. + createdBy: + type: string + description: Output only. Identifier of the principal that created the A/B experiment. + createdAt: + type: string + description: Output only. Timestamp when the A/B experiment was created. + format: date-time + updatedAt: + type: string + description: Output only. Timestamp when the A/B experiment was last updated. + format: date-time + etag: + type: string + description: Optional opaque version tag for optimistic concurrency control. + description: Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants. + DE.ABExperimentMember: + type: object + properties: + deploymentId: + type: string + description: Deployment under the parent endpoint. + role: + enum: + - AB_EXPERIMENT_MEMBER_ROLE_CONTROL + - AB_EXPERIMENT_MEMBER_ROLE_VARIANT + type: string + description: Role of this deployment within the A/B experiment. + percent: + type: integer + description: Integer traffic percent in [1, 100]. Percentages across all members must sum to 100. + description: Deployment participating in an A/B experiment. + required: + - deploymentId + - role + - percent + DE.Placement: + description: Placement controls where a deployment is scheduled. + oneOf: + - type: object + x-stainless-variantName: Inline + required: + - inline + properties: + inline: + description: Inline placement parameters evaluated at deploy time. + allOf: + - $ref: '#/components/schemas/DE.InlinePlacement' + - type: object + x-stainless-variantName: Profile + required: + - profile + properties: + profile: + type: string + description: UID of a saved placement profile. + DE.InlinePlacement: + type: object + properties: + regions: + type: array + items: + type: string + description: Regions where the deployment is allowed to run. Multiple regions allow best-effort replica spreading. + constraint: + enum: + - ENFORCEMENT_REQUIRED + - ENFORCEMENT_PREFERRED + type: string + description: How strictly the regions list is enforced. + description: Inline placement parameters expanded into scheduling rules by the server. + DE.ListModelsResponse: + type: object + description: Custom model resources and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.Model' + description: The list of models. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListSupportedModelsResponse: + type: object + description: Response containing supported models and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.SupportedModel' + description: Supported models in the catalog. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.SupportedModelDeploymentProfile: + type: object + description: Certified deployment profile for a supported model. + required: + - profileId + - certifiedConfigRevisionId + - certifiedModelRevisionId + - gpuType + - gpuCount + - quantization + - performanceBenchmarks + - config + - model + - parallelism + properties: + profileId: + type: string + description: Stable profile identifier, usually the certified config id. + certifiedConfigRevisionId: + type: string + description: Certified configuration revision identifier. + certifiedModelRevisionId: + type: string + description: Certified model weight revision identifier, if available. + gpuType: + type: string + description: GPU instance type for the profile. + gpuCount: + type: integer + description: Number of GPUs required by the profile. + quantization: + type: string + description: Quantization method for the profile, if available. + tensorParallelSize: + type: integer + description: Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the profile. + deprecated: true + performanceBenchmarks: + $ref: '#/components/schemas/DE.SupportedModelPerformanceBenchmarks' + description: Performance benchmarks for the profile, if available. + config: + type: string + description: Certified config revision in the form `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does not pin a config. + model: + type: string + description: Deployable model resource in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when the profile does not pin model weights. + parallelism: + type: string + description: Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD; supersedes tensor_parallel_size. + DE.SupportedModelPerformanceBenchmarks: + type: object + description: Performance benchmark metrics for a supported model profile. + properties: + decodingSpeedTps: + type: number + format: double + description: Decoding throughput in tokens per second. + timeToFirstTokenMs: + type: integer + description: Time to first token in milliseconds. + maxContextLength: + type: string + description: Maximum context length supported by the profile. + DE.SupportedModel: + type: object + description: Curated catalog entry for a platform-supported model. + required: + - id + - name + - displayName + - inputModalities + - outputModalities + - products + - capabilities + - publisher + - status + - displayType + - baseModelId + - baseModel + - deploymentProfiles + - createdAt + - updatedAt + properties: + id: + type: string + description: Unique ID of the deployable Together-hosted base model. + name: + type: string + description: Catalog-controlled HF model ID used for inference. + displayName: + type: string + description: Catalog-controlled human-readable model name. + description: + type: string + description: Human-readable model description. + inputModalities: + type: array + items: + enum: + - MODALITY_TEXT + - MODALITY_IMAGE + - MODALITY_AUDIO + - MODALITY_VIDEO + type: string + description: Input modalities supported by the model. + outputModalities: + type: array + items: + enum: + - MODALITY_TEXT + - MODALITY_IMAGE + - MODALITY_AUDIO + - MODALITY_VIDEO + type: string + description: Output modalities produced by the model. + products: + type: array + items: + enum: + - PRODUCT_SERVERLESS + - PRODUCT_DEDICATED + - PRODUCT_FINE_TUNING + type: string + description: Product surfaces where the model is offered. + features: + type: array + items: + enum: + - FEATURE_TOOL_CALLING + - FEATURE_STRUCTURED_OUTPUT + - FEATURE_REASONING + type: string + description: Advanced features exposed by the model. + capabilities: + type: array + items: + enum: + - CAPABILITY_CHAT + - CAPABILITY_EMBEDDING + - CAPABILITY_RERANKING + - CAPABILITY_IMAGE_GENERATION + - CAPABILITY_VIDEO_GENERATION + type: string + description: High-level tasks the model supports. + architecture: + type: string + description: Model architecture from the underlying weights metadata. + contextLength: + type: string + description: Maximum context length from the underlying weights metadata. + publisher: + type: string + description: Organization or publisher associated with the model. + status: + enum: + - SUPPORTED_MODEL_STATUS_RECOMMENDED + - SUPPORTED_MODEL_STATUS_SUPPORTED + - SUPPORTED_MODEL_STATUS_DEPRECATED + - SUPPORTED_MODEL_STATUS_HIDDEN + type: string + description: Catalog recommendation status for the model. + tags: + type: array + items: + type: string + description: Searchable catalog tags for the model. + inputFormat: + type: string + description: Preferred input format for the model. + outputFormat: + type: string + description: Preferred output format for the model. + serverlessEndpoint: + type: string + description: Serverless endpoint name for inference, if available. + familyId: + type: string + description: Model family identifier for related catalog entries. + displayType: + type: string + description: UI-facing model type badge, such as chat, language, code, image, embedding, rerank, moderation, audio, video, or transcribe. + baseModelId: + type: string + description: Bare model ID for the architecture's base model; empty when no base model is linked. + baseModel: + type: string + description: Resource name for the base model as `projects/{projectId}/models/{modelId}`; empty when unresolved. + deploymentProfiles: + type: array + items: + $ref: '#/components/schemas/DE.SupportedModelDeploymentProfile' + description: Certified deployment profiles available for the model. + createdAt: + type: string + format: date-time + description: Timestamp when the catalog entry was created. + updatedAt: + type: string + format: date-time + description: Timestamp when the catalog entry was last updated. + DE.ListEndpointEventsResponse: + type: object + description: Endpoint and deployment lifecycle events, ordered newest first. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.EndpointEvent' + description: Events for the endpoint, newest first. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListRevisionsResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ListRevisionsResponseRevision' + description: Immutable revisions available for the model. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + description: Immutable model revisions and pagination metadata. + DE.ListProjectConfigsResponse: + type: object + description: Model-compatible config revisions and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ModelConfig' + description: The list of model configs. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListDeploymentsResponse: + type: object + description: Deployments under an endpoint and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.Deployment' + description: The list of deployments. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListABExperimentsResponse: + type: object + description: Managed A/B traffic experiments under an endpoint. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ABExperiment' + description: A/B experiments under the endpoint. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.CreateShadowExperimentRequest: + type: object + description: Sampling strategy and optional initial targets for mirroring endpoint requests without affecting client responses. + required: + - name + - source + properties: + name: + type: string + description: Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + source: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentSource' + description: Endpoint source and sampling configuration for the experiment. + targets: + type: array + items: + $ref: '#/components/schemas/DE.CreateShadowExperimentTargetRequest' + description: Optional initial target deployments. At most 100 targets; manage later changes through the target APIs. + DE.UpdateShadowExperimentRequest: + type: object + description: Mutable description and source sampling strategy for a shadow experiment. + properties: + description: + type: string + description: Updated free-form description. + source: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentSource' + description: Updated endpoint sampling configuration. Source updates require etag in the request body. + etag: + type: string + description: Opaque version tag from a prior read for optimistic concurrency. + DE.CreateShadowExperimentTargetRequest: + type: object + description: Deployment under the parent endpoint that should receive mirrored requests from a shadow experiment. + required: + - name + - targetDeploymentId + properties: + name: + type: string + description: Human-readable target name, unique within the shadow experiment. At most 256 characters. + targetDeploymentId: + type: string + description: Deployment under the parent endpoint that receives mirrored traffic. Exclude it from the endpoint's live traffic split. + description: + type: string + description: Optional free-form target description. + DE.UpdateShadowExperimentTargetRequest: + type: object + description: Mutable name, deployment, and description for a shadow experiment target. + properties: + name: + type: string + description: Updated human-readable target name. + targetDeploymentId: + type: string + description: Replacement deployment under the parent endpoint. Exclude it from the endpoint's live traffic split. + description: + type: string + description: Updated free-form target description. + etag: + type: string + description: Opaque version tag from a prior read for optimistic concurrency. + DE.ListShadowExperimentsResponse: + type: object + description: Response containing shadow experiments and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ShadowExperiment' + description: Shadow experiments under the endpoint. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ListShadowExperimentTargetsResponse: + type: object + description: Response containing shadow experiment targets and pagination metadata. + required: + - data + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DE.ShadowExperimentTarget' + description: Target deployments under the shadow experiment. + next_cursor: + type: string + description: Cursor for the next page. Null if there are no more results. + object: + const: list + description: Object type. Always `list`. + DE.ShadowExperiment: + type: object + description: Experiment that mirrors sampled endpoint requests to target deployments without changing client responses. + required: + - id + - projectId + - endpointId + - name + - source + - targets + - createdAt + - createdBy + - updatedAt + - etag + - state + properties: + id: + type: string + description: Output only. Unique shadow experiment identifier. + readOnly: true + projectId: + type: string + description: Output only. Project that owns the parent endpoint. + readOnly: true + endpointId: + type: string + description: Output only. Endpoint whose traffic this experiment samples. + readOnly: true + name: + type: string + description: Human-readable shadow experiment name, unique within the endpoint. At most 256 characters. + description: + type: string + description: User defined description. + source: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentSourceResponse' + description: Endpoint source and sampling configuration for mirrored requests. + targets: + type: array + items: + $ref: '#/components/schemas/DE.ShadowExperimentTarget' + description: Target deployments that receive mirrored traffic. + createdBy: + type: string + description: Identifier of the principal that created the experiment. + readOnly: true + createdAt: + type: string + description: Timestamp when the experiment was created. + format: date-time + readOnly: true + updatedAt: + type: string + description: Timestamp when the experiment was last updated. + format: date-time + readOnly: true + etag: + type: string + description: Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + state: + type: string + enum: + - SHADOW_EXPERIMENT_STATE_ACTIVE + - SHADOW_EXPERIMENT_STATE_INACTIVE + description: Derived serving state, active when the experiment has at least one target. + readOnly: true + DE.ShadowExperimentTarget: + type: object + description: Deployment that receives mirrored traffic for a shadow experiment. + required: + - id + - experimentId + - name + - targetDeploymentId + - createdAt + - updatedAt + - etag + properties: + id: + type: string + description: Output only. Unique shadow experiment target identifier. + readOnly: true + experimentId: + type: string + description: Output only. Shadow experiment this target belongs to. + readOnly: true + name: + type: string + description: Human-readable target name, unique within the shadow experiment. At most 256 characters. + targetDeploymentId: + type: string + description: Deployment under the parent endpoint that receives mirrored traffic. Shadow targets should be excluded from the endpoint's live traffic split. + description: + type: string + description: Optional free-form target description. + createdAt: + type: string + description: Output only. Timestamp when the target was created. + format: date-time + readOnly: true + updatedAt: + type: string + description: Output only. Timestamp when the target was last updated. + format: date-time + readOnly: true + etag: + type: string + description: Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write. + DE.ShadowExperimentSource: + type: object + description: Traffic source for a shadow experiment. The public API supports endpoint sources only. + required: + - endpoint + properties: + endpoint: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentEndpointSource' + description: Endpoint-level source that samples traffic at the API gateway. + DE.ShadowExperimentEndpointSource: + type: object + description: Endpoint-level source that samples endpoint traffic at the API gateway. + required: + - sampling + properties: + sampling: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentSampling' + description: Sampling strategy applied to endpoint traffic. + DE.ShadowExperimentSourceResponse: + type: object + description: Endpoint traffic source returned for a shadow experiment. + required: + - endpoint + properties: + endpoint: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentEndpointSourceResponse' + description: Endpoint-level source that samples traffic at the API gateway. + DE.ShadowExperimentEndpointSourceResponse: + type: object + description: Endpoint-level source returned for a shadow experiment. + required: + - sampling + properties: + sampling: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentSamplingResponse' + description: Resolved sampling strategy applied to endpoint traffic. + DE.ShadowExperimentSamplingResponse: + description: Sampling strategy returned for endpoint-level shadow traffic. + oneOf: + - type: object + x-stainless-variantName: Uniform + required: + - uniform + properties: + uniform: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentUniformSamplingResponse' + description: Fixed random request sampling. + - type: object + x-stainless-variantName: KeyBased + required: + - keyBased + properties: + keyBased: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentKeyBasedSamplingResponse' + description: Fixed sampling by a sticky request key. + - type: object + x-stainless-variantName: AdaptiveUniform + required: + - adaptiveUniform + properties: + adaptiveUniform: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveUniformSamplingResponse' + description: Adaptive random sampling toward a target QPS. + - type: object + x-stainless-variantName: AdaptiveKeyBased + required: + - adaptiveKeyBased + properties: + adaptiveKeyBased: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveKeyBasedSamplingResponse' + description: Adaptive sticky-key sampling toward a target QPS. + DE.ShadowExperimentUniformSamplingResponse: + type: object + description: Fixed-rate random sampling returned by the API. A zero rate may be omitted by JSON serialization. + properties: + rate: + type: number + description: Fraction of requests sampled, from 0.0 to 1.0. + DE.ShadowExperimentKeyBasedSamplingResponse: + type: object + description: Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted by JSON serialization. + required: + - key + properties: + rate: + type: number + description: Fraction of distinct key values sampled, from 0.0 to 1.0. + key: + type: string + description: Request-body field used as the sticky sampling key. + DE.ShadowExperimentAdaptiveUniformSamplingResponse: + type: object + description: Adaptive random sampling returned by the API. + required: + - targetQps + properties: + targetQps: + type: number + description: Per-gateway-replica target QPS. + window: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Sliding window for QPS observation when explicitly configured. + DE.ShadowExperimentAdaptiveKeyBasedSamplingResponse: + type: object + description: Adaptive sticky-key sampling returned by the API. + required: + - targetQps + - key + properties: + targetQps: + type: number + description: Per-gateway-replica target QPS. + key: + type: string + description: Request-body field used as the sticky sampling key. + window: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Sliding window for QPS observation when explicitly configured. + DE.ShadowExperimentSampling: + description: Sampling strategy for endpoint-level shadow traffic. Exactly one strategy must be set. + oneOf: + - type: object + x-stainless-variantName: Uniform + required: + - uniform + properties: + uniform: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentUniformSampling' + description: Fixed random request sampling. + - type: object + x-stainless-variantName: KeyBased + required: + - keyBased + properties: + keyBased: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentKeyBasedSampling' + description: Fixed sampling by a sticky request key. + - type: object + x-stainless-variantName: AdaptiveUniform + required: + - adaptiveUniform + properties: + adaptiveUniform: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveUniformSampling' + description: Adaptive random sampling toward a target QPS. + - type: object + x-stainless-variantName: AdaptiveKeyBased + required: + - adaptiveKeyBased + properties: + adaptiveKeyBased: + allOf: + - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveKeyBasedSampling' + description: Adaptive sticky-key sampling toward a target QPS. + DE.ShadowExperimentUniformSampling: + type: object + description: Fixed-rate random sampling of endpoint requests. + required: + - rate + properties: + rate: + type: number + description: Required fraction of requests to sample, from 0.0 to 1.0. + DE.ShadowExperimentKeyBasedSampling: + type: object + description: Fixed-rate sampling of distinct key values with sticky decisions. + required: + - rate + - key + properties: + rate: + type: number + description: Required fraction of distinct key values to sample, from 0.0 to 1.0. + key: + type: string + description: Required request-body field used as the sticky sampling key. + DE.ShadowExperimentAdaptiveUniformSampling: + type: object + description: Adaptive random sampling that throttles toward a target QPS. + required: + - targetQps + properties: + targetQps: + type: number + description: Required per-gateway-replica target QPS for adaptive sampling. + window: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + DE.ShadowExperimentAdaptiveKeyBasedSampling: + type: object + description: Adaptive sticky-key sampling that throttles toward a target QPS. + required: + - targetQps + - key + properties: + targetQps: + type: number + description: Required per-gateway-replica target QPS for adaptive sampling. + key: + type: string + description: Required request-body field used as the sticky sampling key. + window: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Optional sliding window for QPS observation. Defaults to 60s and must not be negative. + DE.UpdateModelRequest: + type: object + description: Mutable metadata for a custom model resource. + properties: + name: + type: string + description: Updated inference-addressable model name. + description: + type: string + description: Updated user-facing model description. + visibility: + default: VISIBILITY_PRIVATE + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization. + DE.CreateModelRequest: + type: object + description: Request for registering a custom model or adapter in a project. + required: [name, type, baseModelId] + properties: + name: + type: string + description: Name for the custom model. May be bare or qualified as `/`; a supplied project slug must match the project in the request path. + type: + type: string + description: Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted. + description: + type: string + description: Human-readable description of the model and its intended use. + baseModelId: + type: string + description: ID of the supported base model from which this model was derived. + DE.AccessEntry: + type: object + properties: + principalType: + type: string + description: Principal type. Supported values are `project`, `api_key`, and `organization`. + principalId: + type: string + description: Identifier of the principal. + description: Project, API key, or organization allowed to call an endpoint. + required: + - principalType + - principalId + DE.ListFilesResponseFile: + type: object + properties: + path: + type: string + description: File path within the model revision. + hash: + type: string + description: Content hash for integrity verification and upload deduplication. + sizeBytes: + type: string + description: File size in bytes. + description: Metadata for one file in a model revision. + DE.InferenceInstanceType: + type: object + required: + - id + - name + - description + - gpuType + - gpuCount + - gpuMemoryGib + - priceCentsPerHour + - regions + properties: + id: + type: string + description: Stable hardware instance type identifier used by deployment configs. + name: + type: string + description: Human-readable instance type name. + description: + type: string + description: Human-readable summary of the hardware configuration. + gpuType: + type: string + description: GPU accelerator model, such as `H100` or `B200`. + gpuCount: + type: integer + description: Number of GPUs in one replica of this instance type. + gpuMemoryGib: + type: integer + description: Memory available on each GPU, in GiB. + priceCentsPerHour: + type: integer + description: On-demand price for one running replica, in US cents per hour. + regions: + type: array + items: + $ref: '#/components/schemas/DE.Region' + description: Regions where this instance type is offered. + description: GPU hardware configuration on which one inference replica can run. + DE.Region: + type: object + required: + - name + properties: + name: + type: string + description: Region name where an instance type is offered. + headroom: + allOf: + - $ref: '#/components/schemas/DE.Headroom' + description: Best-effort replica headroom for this region. Omitted when unavailable. + description: Region where an instance type is offered. + DE.Headroom: + type: object + required: + - relation + properties: + value: + type: integer + description: Capped count of replicas that currently fit. + relation: + enum: + - RELATION_EQ + - RELATION_GTE + type: string + description: Whether the value is exact or a lower bound. + description: Best-effort estimate of how many additional replicas currently fit in a region. + DE.AnalyticsData: + type: object + properties: + endpointId: + type: string + description: ID of the endpoint summarized by these analytics. + timeRange: + $ref: '#/components/schemas/DE.MetricsTimeRange' + description: Closed-open time range covered by the analytics. + metrics: + allOf: + - $ref: '#/components/schemas/DE.EndpointMetrics' + description: Aggregated metrics over the time range. + timeSeries: + type: array + items: + $ref: '#/components/schemas/DE.TimeSeriesDataPoint' + description: Per-bucket metric samples, included only when `includeTimeSeries` is true. + deploymentAnalytics: + type: array + items: + $ref: '#/components/schemas/DE.DeploymentAnalyticsData' + description: Per-deployment analytics. + description: Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns. + DE.RemoteUpload: + type: object + required: [id, projectId, modelId, remoteUrl, status, createdAt] + properties: + id: + type: string + description: Unique ID of the remote model import job. + projectId: + type: string + description: ID of the project that owns the import job. + modelId: + type: string + description: ID of the registered model receiving the imported files. + remoteUrl: + type: string + description: Hugging Face repository or presigned URL being imported. + status: + enum: + - REMOTE_UPLOAD_STATUS_PENDING + - REMOTE_UPLOAD_STATUS_RUNNING + - REMOTE_UPLOAD_STATUS_ERROR + - REMOTE_UPLOAD_STATUS_SUCCEEDED + - REMOTE_UPLOAD_STATUS_FAILED + type: string + description: Current lifecycle state of the asynchronous import job. + statusMessage: + type: string + description: Human-readable progress or failure detail for the current status. + restartCount: + type: integer + description: Number of times the import worker has restarted this job. + maxRestarts: + type: integer + description: Maximum worker restarts allowed before the job fails permanently. + createdAt: + type: string + format: date-time + description: Time when the import job was created. + updatedAt: + type: string + format: date-time + description: Time when the import job was last updated. + description: Asynchronous job that imports remote files into a registered model and creates a model revision. + DE.ModelConfig: + type: object + required: + - id + - certifications + - referenceModelId + - selectors + - projectId + - referenceModel + properties: + id: + type: string + description: Config revision identifier. + certifications: + type: array + items: + $ref: '#/components/schemas/DE.Certification' + description: Model, hardware, and runtime combinations certified for this config revision. + referenceModelId: + type: string + description: Deprecated. Use `referenceModel`. Reference model identifier. + selectors: + type: array + items: + $ref: '#/components/schemas/DE.Selector' + description: Hardware and runtime selectors used to place and configure replicas. + projectId: + type: string + description: ID of the project that owns the config revision. Public configs may be owned by a different project than the deployment. + referenceModel: + type: string + description: Resource name of the referenced model, using `projects/{modelProject}/models/{modelId}`. + draftModel: + type: string + description: Resource name of the draft model, using `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is not enabled. + description: Immutable, user-facing configuration revision that defines how a compatible model runs, including engine and hardware selectors. + DE.Model: + description: Custom or derived model registered in a project and backed by versioned weight files. + type: object + required: [id, projectId, organizationId, name, weights, visibility] + properties: + id: + type: string + description: Unique model identifier. + projectId: + type: string + description: ID of the project that owns the model. + organizationId: + type: string + description: ID of the organization that owns the model's project. + name: + type: string + description: Project-qualified model name in the form `/`. Create and update requests may use the bare or qualified form. + description: + type: string + description: Human-readable description of the model and its intended use. + weights: + $ref: '#/components/schemas/DE.ModelWeights' + description: Architecture, size, precision, and speculative-decoding metadata derived from the model files. + baseModelId: + type: string + description: ID of the supported or custom base model from which this model was derived. + baseModel: + type: string + readOnly: true + description: Resource name of the base model, using `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base. + visibility: + default: VISIBILITY_PRIVATE + enum: + - VISIBILITY_PRIVATE + - VISIBILITY_INTERNAL + type: string + description: Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization. + DE.RemoteUploadEvent: + type: object + required: + - id + - createdAt + - level + - type + - message + properties: + id: + type: string + description: Unique event identifier. + createdAt: + type: string + format: date-time + description: Time when the event was recorded. + level: + enum: + - LEVEL_DEBUG + - LEVEL_INFO + - LEVEL_WARN + - LEVEL_ERROR + type: string + description: Severity of the event. + type: + type: string + description: Stable event type emitted by the importer, such as `download.started`. + message: + type: string + description: Human-readable progress or diagnostic message. + description: Progress or diagnostic event emitted while importing remote model files. + DE.Autoscaling: + type: object + properties: + minReplicas: + type: integer + description: Minimum number of replicas. Omit on update to preserve the current value. Set both `minReplicas` and `maxReplicas` to `0` to stop the deployment. + maxReplicas: + type: integer + description: Maximum number of replicas. Defaults to `minReplicas`; omitting it on update preserves the current value. + scaleDownWindow: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Time a lower replica recommendation must remain stable before scaling down. Defaults to `5m`. + scaleUpWindow: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Stabilization window before scaling up. + scaleToZeroWindow: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Idle period after which the deployment automatically stops and releases its replicas. + scalingMetrics: + type: array + items: + $ref: '#/components/schemas/DE.ScalingMetric' + description: Metrics and targets that drive replica recommendations. When omitted, the platform uses concurrent in-flight requests per replica. + description: Autoscaling configuration for a deployment. + DE.AutoscalingResponse: + description: Resolved autoscaling configuration returned for a deployment. + allOf: + - $ref: '#/components/schemas/DE.Autoscaling' + - type: object + required: + - minReplicas + - maxReplicas + DE.DeploymentStatus: + type: object + required: + - state + - message + properties: + state: + enum: + - DEPLOYMENT_STATE_PROVISIONING + - DEPLOYMENT_STATE_READY + - DEPLOYMENT_STATE_SCALING + - DEPLOYMENT_STATE_DEGRADED + - DEPLOYMENT_STATE_FAILED + - DEPLOYMENT_STATE_STOPPED + - DEPLOYMENT_STATE_STOPPING + type: string + description: High-level lifecycle state. + readyReplicas: + type: integer + description: Total replicas actively serving traffic across all clusters. + message: + type: string + description: Human-readable explanation of the current state. + scheduledReplicas: + type: integer + description: Replicas the scheduler has placed on clusters. + description: Current status of a deployment, derived at read time from internal state. + DE.RuntimeInfo: + type: object + properties: + engineType: + type: string + description: Serving engine, such as `vllm`, `trtllm`, or `sglang`. + engineVersion: + type: string + description: Version of the serving engine. + functionCallingSupported: + type: boolean + description: Whether the runtime accepts tool and function-calling requests. + structuredOutputSupported: + type: boolean + description: Whether the runtime can constrain generation to a structured output schema. + description: Runtime information derived from the deployment's configuration. + DE.EndpointEvent: + type: object + required: + - id + - createdAt + - level + - type + - source + - sourceKind + - endpointId + properties: + id: + type: string + description: Output only. Unique event identifier. + createdAt: + type: string + description: Output only. Event creation time. + format: date-time + level: + enum: + - LEVEL_DEBUG + - LEVEL_INFO + - LEVEL_WARN + - LEVEL_ERROR + type: string + description: Output only. Severity level. + type: + type: string + description: Output only. Stable event type, such as `endpoint.updated`, `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`. + message: + type: string + description: Output only. Human-readable description of the event. Short and stable; not structured data. + source: + type: string + description: Output only. Service, cluster, or controller that emitted the event. + sourceKind: + enum: + - SOURCE_KIND_ENDPOINT + - SOURCE_KIND_DEPLOYMENT + type: string + description: Output only. Whether this row describes the endpoint or one of its deployments. + endpointId: + type: string + description: Output only. The endpoint this event belongs to. Always set. + deploymentId: + type: string + description: Output only. Deployment associated with the event when `sourceKind` is `SOURCE_KIND_DEPLOYMENT`. + subjectId: + type: string + description: Output only. ID of the event's subject, such as a rollout, shadow target, or condition type. + name: + type: string + description: 'Resource name at the time of the event. Populated by: deployment.created, deployment.deleted, endpoint.created, endpoint.deleted' + paths: + type: array + items: type: string - - name: instance_id - in: path - required: true - schema: + description: 'Field-mask paths that were modified. Populated by: deployment.updated, endpoint.updated' + oldReplicas: + type: integer + description: 'Replica-count transition. Populated by: deployment.scaled' + newReplicas: + type: integer + description: New replica count for a `deployment.scaled` event. + version: + type: integer + description: 'Target version. Populated by `target.created`; the target ID is carried in `subjectId`.' + status: + type: string + description: 'Condition status for `condition.set` and `cluster_condition.set`: `True`, `False`, or `Unknown`. The condition type is carried in `subjectId`.' + reason: + type: string + description: Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or `ApplySuccessful`. + clusterId: + type: string + description: ID of the cluster associated with a cluster-scoped event. + serviceType: + type: string + description: Deployment subservice associated with the event, such as `model-deployment` or `speculator-deployment`. + replicaId: + type: string + description: Opaque replica identity associated with a `pod.*` event, stable for grouping events from the same replica. + containerName: + type: string + description: Stable public component label associated with a replica event, such as `engine`, `model-download`, or `sidecar`. + logExcerpt: + type: string + description: Short diagnostic log excerpt captured with a pod event, for example during a crash, out-of-memory termination, or image pull failure. This field is truncated and is not a streaming log API. + nodeId: + type: string + description: Opaque node handle for correlating replica failures on the same node. Omitted when the replica is unscheduled or the node is unknown. + description: One endpoint- or deployment-scoped entry in an endpoint's combined audit and lifecycle feed. + DE.ListRevisionsResponseRevision: + type: object + required: + - revisionId + - createdAt + properties: + revisionId: + type: string + description: Revision identifier. + createdAt: + type: string + format: date-time + description: Timestamp when the revision was created. + validationStatus: + enum: + - REVISION_VALIDATION_STATUS_PENDING + - REVISION_VALIDATION_STATUS_SUCCESS + - REVISION_VALIDATION_STATUS_FAILED + - REVISION_VALIDATION_STATUS_ERROR + type: string + description: Current validation status for the revision. + lastValidatedAt: + type: string + format: date-time + description: Timestamp when validation most recently ran for the revision. + validationErrors: + type: array + items: + $ref: '#/components/schemas/DE.RevisionValidationError' + description: Validation errors reported for the revision. + description: Revision metadata for a volume object. + DE.RevisionValidationError: + type: object + properties: + rule: + type: string + description: Validation rule that produced the error. + severity: + type: string + description: Severity level reported by the validation rule. + message: + type: string + description: Human-readable validation error message. + description: One validation error reported for a model revision. + DE.DeploymentAnalyticsData: + type: object + properties: + deploymentId: + type: string + description: ID of the deployment summarized by these analytics. + endpointId: + type: string + description: ID of the deployment's parent endpoint. + timeRange: + $ref: '#/components/schemas/DE.MetricsTimeRange' + description: Closed-open time range covered by the analytics. + metrics: + $ref: '#/components/schemas/DE.DeploymentMetrics' + description: Aggregate operational metrics for the deployment. + timeSeries: + type: array + items: + $ref: '#/components/schemas/DE.TimeSeriesDataPoint' + description: Per-bucket metric samples for the deployment. + description: Usage and performance analytics for one deployment under an endpoint. + DE.EndpointMetrics: + type: object + properties: + endpointId: + type: string + description: The endpoint these metrics describe. + timeRange: + allOf: + - $ref: '#/components/schemas/DE.MetricsTimeRange' + description: Time range covered by the metrics. + requestMetrics: + $ref: '#/components/schemas/DE.RequestMetrics' + description: Request counts and rates. + latencyMetrics: + $ref: '#/components/schemas/DE.LatencyMetrics' + description: Time-to-first-token, end-to-end, and inter-token latency percentiles. + throughputMetrics: + $ref: '#/components/schemas/DE.ThroughputMetrics' + description: Token, request, and batching throughput. + errorMetrics: + $ref: '#/components/schemas/DE.ErrorMetrics' + description: Error rate and counts by error type. + resourceUtilization: + $ref: '#/components/schemas/DE.ResourceUtilization' + description: Average CPU, GPU, memory, and network utilization. + tokenMetrics: + $ref: '#/components/schemas/DE.TokenMetrics' + description: Input and output token totals and averages. + deploymentMetrics: + type: array + items: + $ref: '#/components/schemas/DE.DeploymentMetrics' + description: Per-deployment breakdown, if the endpoint has multiple deployments. + description: Operational metrics aggregated across all deployments receiving traffic for an endpoint. + DE.MetricsTimeRange: + type: object + properties: + startTime: + type: string + description: Inclusive start of the time range. + format: date-time + endTime: + type: string + description: Exclusive end of the time range. + format: date-time + description: Closed-open time range used by metrics and analytics responses. + DE.TimeSeriesDataPoint: + type: object + properties: + timestamp: + type: string + format: date-time + description: Start time of the metric bucket. + values: + type: object + additionalProperties: + type: number + description: Metric names mapped to their numeric values for this bucket. + description: Timestamped bucket containing one or more named metric values. + DE.Config: + type: object + properties: + id: + type: string + description: Unique config revision identifier. + engineType: + enum: + - ENGINE_TYPE_PULSAR + - ENGINE_TYPE_VLLM + - ENGINE_TYPE_SGLANG + - ENGINE_TYPE_TGL + - ENGINE_TYPE_TRTLLM + - ENGINE_TYPE_SMG + type: string + description: Inference engine used to serve the model. + deploymentFramework: + enum: + - DEPLOYMENT_FRAMEWORK_DEFAULT + - DEPLOYMENT_FRAMEWORK_ROLLOUTS + - DEPLOYMENT_FRAMEWORK_LWS + - DEPLOYMENT_FRAMEWORK_DYNAMO + - DEPLOYMENT_FRAMEWORK_GROVE + type: string + description: Orchestration framework used to run replicas for this config. + selectors: + type: array + items: + $ref: '#/components/schemas/DE.ConfigSelector' + description: Hardware and runtime selectors resolved by the config. + selectorsHash: + type: string + description: Stable hash of the resolved selectors, used to identify equivalent configs. + description: Resolved inference engine, orchestration framework, and selectors for one config revision. + DE.Certification: + type: object + required: + - target + - certificationType + - certifiedAt + - certifiedBy + - model + - modelRevisionId + properties: + target: + enum: + - CERTIFICATION_TARGET_DE_SERVERLESS + - CERTIFICATION_TARGET_MRE + type: string + description: Product or serving environment for which the combination was evaluated. + certificationType: + enum: + - CERTIFICATION_TYPE_CERTIFIED + - CERTIFICATION_TYPE_UNCERTIFIED + type: string + description: Whether the model and config combination passed certification. + certifiedAt: + type: string + format: date-time + description: Time when the certification decision was recorded. + certifiedBy: + type: string + description: Service or reviewer that recorded the certification. + notes: + type: string + description: Human-readable certification notes or limitations. + model: + type: string + description: Resource name of the certified model. + modelRevisionId: + type: string + description: Revision identifier of the certified model. + draftModel: + type: string + description: Resource name of the certified draft model. + draftModelRevisionId: + type: string + description: Revision identifier of the certified draft model. + description: Certification result for a model, config, and optional draft-model combination. + DE.Selector: + type: object + required: + - key + - value + properties: + key: + type: string + description: Selector name, such as GPU type, GPU count, or optimization profile. + value: + type: string + description: Required value for the selector. + description: Hardware or runtime requirement expressed as a key-value pair. + DE.ModelExternal: + type: object + properties: + url: + type: string + description: Canonical external URL for the model, such as its Hugging Face repository. + description: External source associated with a model. + DE.ModelLicense: + type: object + properties: + name: + type: string + description: License identifier or name reported by the model source. + description: License metadata associated with a model. + DE.ModelWeights: + type: object + properties: + type: + enum: + - WEIGHTS_TYPE_DEFAULT + - WEIGHTS_TYPE_SPECULATOR + - WEIGHTS_TYPE_ADAPTER + type: string + description: 'Role of the weights: full model, speculative draft model, or LoRA adapter.' + speculatorMechanism: + enum: + - SPECULATOR_MECHANISM_DRAFT + - SPECULATOR_MECHANISM_LOOKAHEAD + - SPECULATOR_MECHANISM_MTP + type: string + description: Speculative decoding mechanism for speculator weights. + draftSpeculatorType: + enum: + - DRAFT_SPECULATOR_TYPE_EAGLE + - DRAFT_SPECULATOR_TYPE_PHOENIX + type: string + description: Draft-model speculator family for draft speculative decoding. + architecture: + type: string + description: Model architecture detected from the weight metadata. + contextLength: + type: string + description: Maximum context length reported by the model metadata. + parameters: + $ref: '#/components/schemas/DE.ModelParameters' + description: Total parameter count and breakdown by numerical data type. + description: Architecture, size, precision, and speculative-decoding metadata for model weights. + DE.ScalingMetric: + type: object + properties: + name: + type: string + description: Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`, `e2e_latency`, `throughput_per_replica`, or `decoding_speed`. + type: + enum: + - METRIC_TARGET_TYPE_VALUE + - METRIC_TARGET_TYPE_UTILIZATION + - METRIC_TARGET_TYPE_AVERAGE_VALUE + type: string + description: Whether `target` is an absolute value, a utilization percentage, or a per-replica average. + target: + type: number + description: Target interpreted according to `type`. Utilization uses a percentage from 0 to 100, value uses an absolute measurement, and average value uses a per-replica measurement. + percentile: + type: string + description: 'Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.' + description: Metric and target used by the autoscaler to recommend a replica count. + required: + - name + - type + - target + DE.DeploymentMetrics: + type: object + properties: + deploymentId: + type: string + description: ID of the deployment summarized by these metrics. + endpointId: + type: string + description: ID of the deployment's parent endpoint. + timeRange: + $ref: '#/components/schemas/DE.MetricsTimeRange' + description: Closed-open time range covered by the metrics. + requestMetrics: + $ref: '#/components/schemas/DE.RequestMetrics' + description: Request counts and rates. + latencyMetrics: + $ref: '#/components/schemas/DE.LatencyMetrics' + description: Time-to-first-token, end-to-end, and inter-token latency percentiles. + throughputMetrics: + $ref: '#/components/schemas/DE.ThroughputMetrics' + description: Token, request, and batching throughput. + errorMetrics: + $ref: '#/components/schemas/DE.ErrorMetrics' + description: Error rate and counts by error type. + resourceUtilization: + $ref: '#/components/schemas/DE.ResourceUtilization' + description: Average CPU, GPU, memory, and network utilization. + tokenMetrics: + $ref: '#/components/schemas/DE.TokenMetrics' + description: Input and output token totals and averages. + description: Operational metrics for one deployment under an endpoint. + DE.ErrorMetrics: + type: object + properties: + errorRate: + type: number + description: Percentage in [0, 100]. + errorsByType: + type: object + additionalProperties: type: string - - name: remediation_id - in: path - required: true - schema: + description: Counts of errors keyed by error type (e.g. HTTP status code or error kind). + description: Error rate and aggregate counts by error type. Individual error samples are not included. + DE.LatencyMetrics: + type: object + properties: + ttftP50Ms: + type: number + description: 50th-percentile time to first token, in milliseconds. + ttftP90Ms: + type: number + description: 90th-percentile time to first token, in milliseconds. + ttftP99Ms: + type: number + description: 99th-percentile time to first token, in milliseconds. + latencyP50Ms: + type: number + description: 50th-percentile end-to-end request latency, in milliseconds. + latencyP90Ms: + type: number + description: 90th-percentile end-to-end request latency, in milliseconds. + latencyP99Ms: + type: number + description: 99th-percentile end-to-end request latency, in milliseconds. + itlP50Ms: + type: number + description: 50th-percentile inter-token latency, in milliseconds. + itlP90Ms: + type: number + description: 90th-percentile inter-token latency, in milliseconds. + itlP99Ms: + type: number + description: 99th-percentile inter-token latency, in milliseconds. + description: Time-to-first-token, end-to-end, and inter-token latency percentiles in milliseconds. + DE.RequestMetrics: + type: object + properties: + totalRequests: + type: string + description: Total requests received during the time range. + successfulRequests: + type: string + description: Requests completed successfully during the time range. + failedRequests: + type: string + description: Requests that failed during the time range. + requestsPerSecond: + type: number + description: Average requests per second over the time range. + requestsByStatusCode: + type: object + additionalProperties: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CommentBody' - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Remediation' -components: - securitySchemes: - bearerAuth: - type: http - scheme: bearer - x-bearer-format: bearer - x-default: default - schemas: + description: Request counts keyed by HTTP status code. + description: Request counts, rate, and status-code distribution over a time range. + DE.ResourceUtilization: + type: object + properties: + cpuUtilization: + type: number + description: Average CPU utilization across replicas, as a percentage. + gpuUtilization: + type: number + description: Average GPU compute utilization across replicas, as a percentage. + memoryUtilization: + type: number + description: Average system memory utilization across replicas, as a percentage. + gpuMemoryUtilization: + type: number + description: Average GPU memory utilization across replicas, as a percentage. + networkBandwidthMbps: + type: number + description: Average network throughput across replicas, in megabits per second. + description: Average compute, memory, and network utilization for replicas over a time range. + DE.ThroughputMetrics: + type: object + properties: + tokensPerSecond: + type: number + description: Average generated tokens per second. + requestsPerSecond: + type: number + description: Average completed requests per second. + avgBatchSize: + type: number + description: Average number of requests processed in each runtime batch. + avgBatchDepth: + type: number + description: Average number of batches queued or in flight in the serving engine. + description: Token, request, and batching throughput over a time range. + DE.TokenMetrics: + type: object + properties: + totalInputTokens: + type: string + description: Total input tokens processed during the time range. + totalOutputTokens: + type: string + description: Total output tokens generated during the time range. + avgInputTokens: + type: number + description: Average input tokens per request. + avgOutputTokens: + type: number + description: Average output tokens per request. + description: Aggregate and per-request token usage over a time range. + DE.ConfigSelector: + type: object + properties: + id: + type: string + description: Unique selector identifier. + key: + type: string + description: Selector name, such as GPU type, GPU count, or optimization profile. + value: + type: string + description: Required value for the selector. + description: Hardware or runtime requirement associated with a config revision. + DE.ModelParameters: + type: object + required: + - total + - byDtype + properties: + total: + type: string + description: Total number of parameters in the model weights. + byDtype: + type: array + items: + $ref: '#/components/schemas/DE.ModelDTypeCount' + description: Parameter counts grouped by numerical data type. + description: Model parameter count and precision breakdown. + DE.ModelDTypeCount: + type: object + required: + - dtype + - count + properties: + dtype: + type: string + description: Numerical data type, such as `float16`, `bfloat16`, or `int8`. + count: + type: string + description: Number of model parameters stored with this data type. + description: Number of model parameters stored in one numerical data type. + RL.OptimStepBody: type: object + required: + - weight_sync_type properties: - learning_rate: - description: Learning rate for this step. + weight_sync_type: + $ref: '#/components/schemas/RL.WeightSyncType' + description: How the trainer's updated weights are propagated to the generator after this optimizer step. See `WeightSyncType` for accepted values. + max_grad_norm: type: number format: float - example: 0.0001 - default: '0.0001' + example: 10 + default: "1.0" + description: Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. adamw_params: $ref: '#/components/schemas/RL.AdamWOptimizerParams' + muon_params: + $ref: '#/components/schemas/RL.MuonOptimizerParams' RL.SampleBody: type: object required: @@ -8857,102 +15167,361 @@ components: description: Optional sampling parameters num_samples: type: integer - format: int64 + example: 1 - default: '1' + default: "1" description: Number of completions to generate per prompt RL.ForwardBackwardBody: type: object required: - - samples - - loss + - samples + - loss + properties: + samples: + description: Batch of training samples to process + type: array + items: + type: object + $ref: '#/components/schemas/RL.TrainingSample' + loss: + description: Loss function configuration + $ref: '#/components/schemas/RL.LossConfig' + RL.ModelInput: + type: object + required: + - chunks + properties: + chunks: + description: Input chunks for the model + type: array + items: + type: object + $ref: '#/components/schemas/RL.InputChunk' + RL.SamplingParams: + type: object + properties: + max_tokens: + type: integer + example: 512 + default: "512" + description: Maximum number of tokens to generate per completion + temperature: + type: number + example: 1 + default: "1.0" + description: Sampling temperature + top_p: + type: number + example: 1 + default: "1.0" + description: Nucleus sampling probability threshold + top_k: + type: integer + example: -1 + default: "-1" + description: Top-k sampling limit + stop: + type: array + example: + - "\n" + - END + items: + type: string + description: Generation stops when any of these strings is produced + seed: + oneOf: + - type: string + - type: integer + example: "42" + description: Random seed for reproducibility + return_prompt_logprobs: + type: boolean + example: false + default: "false" + description: When true, also return teacher-forced log-probabilities for the prompt tokens in `SampleRollout.prompt_logprobs`. + RL.InputChunk: + type: object + properties: + encoded_text: + $ref: '#/components/schemas/RL.EncodedText' + RL.ListMeta: + type: object + description: Pagination metadata for list responses + properties: + limit: + type: integer + example: 20 + description: Maximum number of items returned per page + has_more: + type: boolean + example: true + description: Whether more items exist beyond this page + next_cursor: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Cursor to use as the 'after' parameter for the next page. Empty when has_more is false. + RL.ModelFullModeConfig: + type: object + description: Full-weight training config. If present, the model supports full-weight training. + required: + - max_batch_size + - max_seq_length + properties: + max_batch_size: + type: integer + example: 512 + description: Maximum global batch size accepted by a forward-backward step + max_seq_length: + type: integer + example: 40960 + description: Maximum sequence length in tokens + RL.ModelLoraModeConfig: + type: object + description: LoRA training config. If present, the model supports LoRA training. + required: + - max_batch_size + - max_seq_length + - max_rank + properties: + max_batch_size: + type: integer + example: 512 + description: Maximum global batch size accepted by a forward-backward step + max_seq_length: + type: integer + example: 40960 + description: Maximum sequence length in tokens + max_rank: + type: integer + example: 64 + description: Maximum LoRA rank + RL.ComputeConfig: + type: object + description: Compute layout for a model resource + required: + - num_generator_replicas + properties: + num_generator_replicas: + type: integer + format: int32 + example: 1 + description: Number of generator replicas. 0 means the resource runs the trainer only, with no generator. + RL.ComputeConfigCreateRequest: + type: object + description: Compute layout to provision for a model resource + properties: + num_generator_replicas: + type: integer + format: int32 + example: 2 + default: "1" + description: Number of generator replicas. 0 runs the trainer only, with no generator. + RL.ModelResourcesStatus: + description: Lifecycle status of a model resource + type: string + enum: + - MODEL_RESOURCES_STATUS_PENDING + - MODEL_RESOURCES_STATUS_CREATING + - MODEL_RESOURCES_STATUS_READY + - MODEL_RESOURCES_STATUS_ERROR + - MODEL_RESOURCES_STATUS_STOPPED + - MODEL_RESOURCES_STATUS_STOPPING + RL.ModelResources: + type: object + description: Allocated GPU resources that training sessions attach to + required: + - id + - status + - base_model + - compute_config + - lora_enabled + - created_at + - updated_at + - optimizer_config + - created_by + properties: + id: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Unique identifier for the model resource + status: + $ref: '#/components/schemas/RL.ModelResourcesStatus' + example: MODEL_RESOURCES_STATUS_READY + description: Lifecycle status of the model resource + error: + $ref: '#/components/schemas/RL.ModelResourcesError' + description: Structured detail for the model resource's current error. Set when the resource is in an error state. + base_model: + type: string + example: Qwen/Qwen3-0.6B + description: Base model the resource is provisioned for + compute_config: + $ref: '#/components/schemas/RL.ComputeConfig' + description: Compute layout provisioned for the resource. + lora_enabled: + type: boolean + example: true + description: Whether the resource hosts LoRA sessions or a full-weight session + created_at: + type: string + format: date-time + example: "2026-01-02T00:00:00Z" + description: Timestamp when the model resource was created + updated_at: + type: string + format: date-time + example: "2026-01-02T00:00:05Z" + description: Timestamp when the model resource was last updated + optimizer_config: + $ref: '#/components/schemas/RL.OptimizerConfig' + description: Optimizer configuration for this resource. + created_by: + type: string + example: user_123 + description: ID of the user who created the model resource + RL.ModelResourcesError: + type: object + description: Structured detail for the model resource's current error + required: + - code + - message + - occurred_at + properties: + code: + $ref: '#/components/schemas/RL.ModelResourcesErrorCode' + example: MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE + description: Finite machine-readable reason code for UI branching + message: + type: string + example: Capacity is currently unavailable. Try again later. + description: User-safe human-readable detail for the current status + occurred_at: + type: string + format: date-time + example: "2026-01-02T00:00:05Z" + description: Timestamp when this error was reported + RL.ModelResourcesErrorCode: + type: string + description: Finite machine-readable model resource lifecycle error code + enum: + - MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE + - MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED + RL.CreateModelResourcesRequest: + type: object + description: Request to provision a standalone model resource + required: + - base_model + properties: + base_model: + type: string + example: Qwen/Qwen3-0.6B + description: Base model to provision the resource for + compute_config: + $ref: '#/components/schemas/RL.ComputeConfigCreateRequest' + description: Compute layout to provision. + lora_enabled: + type: boolean + default: true + example: true + description: Whether the resource hosts LoRA sessions or a single full-weight session + optimizer_config: + $ref: '#/components/schemas/RL.OptimizerConfig' + description: Optimizer configuration for this resource. + RL.ModelResourcesEstimateCostResponse: + type: object + properties: + price_per_hour: + type: number + format: double + example: 56 + description: Estimated on-demand price per hour in the currency's major unit. + currency: + type: string + example: USD + description: ISO 4217 currency code. + required: + - price_per_hour + - currency + RL.ModelResourcesListResponse: + type: object + description: Paginated list of model resources + required: + - data + - meta properties: - samples: - description: Batch of training samples to process + data: type: array items: - type: object - $ref: '#/components/schemas/RL.TrainingSample' - loss: - description: Loss function configuration - $ref: '#/components/schemas/RL.LossConfig' - RL.ModelInput: + $ref: '#/components/schemas/RL.ModelResources' + description: List of model resources + meta: + $ref: '#/components/schemas/RL.ListMeta' + description: Pagination metadata + RL.ModelTrainerConfig: type: object - required: - - chunks + description: Training config. Each sub-mode is present only when the model supports that training mode. properties: - chunks: - description: Input chunks for the model - type: array - items: - type: object - $ref: '#/components/schemas/RL.InputChunk' - RL.SamplingParams: + full: + $ref: '#/components/schemas/RL.ModelFullModeConfig' + description: Full-weight training config. Set when the model supports full-weight training. + lora: + $ref: '#/components/schemas/RL.ModelLoraModeConfig' + description: LoRA training config. Set when the model supports LoRA training. + RL.ModelSamplingDefaults: type: object + description: Default sampling parameters used for a Sample request. + required: + - "n" + - max_tokens + - temperature + - logprobs properties: + "n": + type: integer + example: 1 + description: Number of completions per prompt max_tokens: type: integer - format: int32 - example: 100 - default: '100' - description: Maximum number of tokens to generate per completion + example: 512 + description: Maximum tokens generated per completion temperature: type: number example: 1 - format: float - default: '1.0' description: Sampling temperature - top_p: - type: number - example: 1 - format: float - default: '1.0' - description: Nucleus sampling probability threshold - top_k: + logprobs: type: integer - format: int32 - example: -1 - default: '-1' - description: Top-k sampling limit - stop: - type: array - example: - - |+ - - - END - items: - type: string - description: Generation stops when any of these strings is produced - seed: - oneOf: - - type: string - - type: integer - example: '42' - description: Random seed for reproducibility - RL.InputChunk: + example: 1 + description: Number of logprobs to return per token + RL.ModelGeneratorConfig: type: object + description: Inference config. If present, the model can be provisioned with one or more generator replicas. + required: + - context_length + - sampling_defaults properties: - encoded_text: - $ref: '#/components/schemas/RL.EncodedText' - RL.ListMeta: + context_length: + type: integer + example: 40960 + description: Maximum tokens in a single inference request (prompt + completion) + sampling_defaults: + $ref: '#/components/schemas/RL.ModelSamplingDefaults' + description: Default sampling parameters used for sample requests. + RL.SupportedModel: type: object - description: Pagination metadata for list responses + description: A base model supported by the RL service. Per-mode configs are present only when the model supports that mode. + required: + - base_model properties: - limit: - type: integer - format: int32 - example: 20 - description: Maximum number of items returned per page - has_more: - type: boolean - example: true - description: Whether more items exist beyond this page - next_cursor: + base_model: type: string - example: 123e4567-e89b-12d3-a456-426614174000 - description: >- - Cursor to use as the 'after' parameter for the next page. Empty when - has_more is false. + example: Qwen/Qwen3-0.6B + description: Base model identifier to pass as base_model when creating a model resource + trainer_config: + $ref: '#/components/schemas/RL.ModelTrainerConfig' + description: Training config. Set when the model supports at least one training mode. + generator_config: + $ref: '#/components/schemas/RL.ModelGeneratorConfig' + description: Inference config. Set when the model can be provisioned with generator replicas. RL.EncodedText: type: object required: @@ -8979,11 +15548,25 @@ components: default: D_TYPE_UNSPECIFIED RL.LossType: type: string + description: Type of loss function used for RL training. enum: - LOSS_TYPE_UNSPECIFIED - LOSS_TYPE_CROSS_ENTROPY - LOSS_TYPE_GRPO + - LOSS_TYPE_IMPORTANCE_SAMPLING + - LOSS_TYPE_PPO + - LOSS_TYPE_CISPO + - LOSS_TYPE_DRO default: LOSS_TYPE_UNSPECIFIED + RL.WeightSyncType: + type: string + description: How the trainer's updated weights are propagated to the generator after an optimizer step. SYNCHRONOUS publishes inline before the step returns; BACKGROUND_PUBLISH returns immediately and publishes once in-flight rollouts drain; PIPELINE overlaps the publish with in-flight rollouts so they continue decoding under the new weights. + enum: + - WEIGHT_SYNC_TYPE_UNSPECIFIED + - WEIGHT_SYNC_TYPE_SYNCHRONOUS + - WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH + - WEIGHT_SYNC_TYPE_PIPELINE + default: WEIGHT_SYNC_TYPE_UNSPECIFIED RL.CrossEntropyLossParams: type: object description: Cross-entropy loss parameters (currently empty). @@ -8991,29 +15574,33 @@ components: RL.GRPOLossParams: type: object properties: - clip_low: + clip_low_threshold: type: number format: float - example: 0.2 - default: '0.2' - description: Lower clip bound for importance ratio - clip_high: + example: 0.8 + default: "0.8" + description: Lower clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be <= 1. + clip_high_threshold: type: number format: float - example: 0.28 - default: '0.28' - description: Upper clip bound for importance ratio + example: 1.2 + default: "1.2" + description: Upper clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be >= 1. beta: type: number - format: float example: 0.1 - default: '0.0' + default: "0.0" description: KL penalty coefficient agg_type: $ref: '#/components/schemas/RL.GRPOLossAggregationType' example: GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON - default: GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON + default: "GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON" description: Aggregation type for loss computation + ratio_type: + $ref: '#/components/schemas/RL.GRPOLossRatioType' + example: GRPO_LOSS_RATIO_TYPE_TOKEN + default: "GRPO_LOSS_RATIO_TYPE_TOKEN" + description: Controls how the importance-sampling ratio is computed in GRPO loss. Defaults to token-level ratios, which is the standard GRPO behavior. Use sequence-level ratios to enable GSPO-style loss calculation instead. RL.GRPOLossAggregationType: type: string enum: @@ -9022,6 +15609,53 @@ components: - GRPO_LOSS_AGGREGATION_TYPE_TOKEN_MEAN - GRPO_LOSS_AGGREGATION_TYPE_SEQUENCE_MEAN default: GRPO_LOSS_AGGREGATION_TYPE_UNSPECIFIED + RL.GRPOLossRatioType: + type: string + description: Controls whether GRPO loss uses token-level or sequence-level importance ratios. + enum: + - GRPO_LOSS_RATIO_TYPE_TOKEN + - GRPO_LOSS_RATIO_TYPE_SEQUENCE + default: GRPO_LOSS_RATIO_TYPE_TOKEN + RL.PPOLossParams: + type: object + properties: + clip_low_threshold: + type: number + format: float + example: 0.8 + default: "0.8" + description: Lower absolute bound for the importance ratio in the clipped surrogate. Must be <= 1. + clip_high_threshold: + type: number + format: float + example: 1.2 + default: "1.2" + description: Upper absolute bound for the importance ratio in the clipped surrogate. Must be >= 1. + RL.CispoLossParams: + type: object + properties: + clip_low_threshold: + type: number + format: float + example: 0 + default: "0.0" + description: Lower absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient + clip_high_threshold: + type: number + format: float + example: 4 + default: "4.0" + description: Upper absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient + RL.DroLossParams: + type: object + properties: + beta: + type: number + format: float + example: 0.05 + description: Coefficient on the quadratic log-ratio penalty. Required; there is no default. + required: + - beta RL.LossConfig: type: object required: @@ -9035,6 +15669,12 @@ components: $ref: '#/components/schemas/RL.CrossEntropyLossParams' grpo_params: $ref: '#/components/schemas/RL.GRPOLossParams' + ppo_params: + $ref: '#/components/schemas/RL.PPOLossParams' + cispo_params: + $ref: '#/components/schemas/RL.CispoLossParams' + dro_params: + $ref: '#/components/schemas/RL.DroLossParams' RL.LossTargetTokens: type: object required: @@ -9089,7 +15729,6 @@ components: - 0.5 items: type: number - format: float dtype: description: Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16) $ref: '#/components/schemas/RL.DType' @@ -9107,7 +15746,6 @@ components: - -0.8 items: type: number - format: float dtype: description: Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16) $ref: '#/components/schemas/RL.DType' @@ -9127,17 +15765,77 @@ components: reference_logprobs: $ref: '#/components/schemas/RL.LossLogprobs' description: Reference model log probabilities (required if beta > 0) + RL.ImportanceSamplingLossInputs: + type: object + description: Loss inputs for unclipped importance-sampling policy-gradient updates. + required: + - advantages + - generator_logprobs + properties: + advantages: + $ref: '#/components/schemas/RL.LossAdvantages' + description: Per-token advantages for importance sampling + generator_logprobs: + $ref: '#/components/schemas/RL.LossLogprobs' + description: Generator log probabilities for importance sampling + RL.PPOLossInputs: + type: object + properties: + advantages: + $ref: '#/components/schemas/RL.LossAdvantages' + description: Per-token advantages for PPO + generator_logprobs: + $ref: '#/components/schemas/RL.LossLogprobs' + description: Generator log probabilities for PPO + required: + - advantages + - generator_logprobs + RL.CispoLossInputs: + type: object + properties: + advantages: + $ref: '#/components/schemas/RL.LossAdvantages' + description: Per-token advantages for CISPO + generator_logprobs: + $ref: '#/components/schemas/RL.LossLogprobs' + description: Generator log probabilities for CISPO + required: + - advantages + - generator_logprobs + RL.DroLossInputs: + type: object + properties: + advantages: + $ref: '#/components/schemas/RL.LossAdvantages' + description: Per-token advantages for DRO + generator_logprobs: + $ref: '#/components/schemas/RL.LossLogprobs' + description: Generator log probabilities for DRO + required: + - advantages + - generator_logprobs RL.LossInputs: type: object + description: Token-level inputs used to compute the loss for one training sample. properties: target_tokens: $ref: '#/components/schemas/RL.LossTargetTokens' description: Target tokens for loss computation loss_mask: $ref: '#/components/schemas/RL.LossMask' - description: Per-token loss mask (1=compute loss, 0=ignore) + description: Per-token loss mask (1=compute loss, 0=ignore). Required for cross-entropy forward-backward; optional for forward and advantage-based losses, where omission includes all tokens. grpo_inputs: $ref: '#/components/schemas/RL.GRPOLossInputs' + description: Inputs required when the loss type is GRPO + importance_sampling_inputs: + $ref: '#/components/schemas/RL.ImportanceSamplingLossInputs' + description: Inputs required when the loss type is importance sampling + ppo_inputs: + $ref: '#/components/schemas/RL.PPOLossInputs' + cispo_inputs: + $ref: '#/components/schemas/RL.CispoLossInputs' + dro_inputs: + $ref: '#/components/schemas/RL.DroLossInputs' required: - target_tokens RL.TrainingSample: @@ -9152,6 +15850,29 @@ components: loss_inputs: description: Loss function inputs $ref: '#/components/schemas/RL.LossInputs' + policy_segments: + type: array + items: + type: object + $ref: '#/components/schemas/RL.PolicyVersionSegment' + description: Policy versions that produced this sample's tokens. Echo back from `SampleResult.policy_segments`. + RL.PolicyVersionSegment: + type: object + description: A (policy version, starting token) span within a rollout. Version 0 is the initial model; each optim_step call increments the version by 1. + required: + - version + - start_token + properties: + version: + type: integer + format: int32 + example: 5 + description: Model version under which this segment of tokens was generated + start_token: + type: integer + format: int32 + example: 0 + description: Index of the first token of this segment within the rollout's token sequence. Always 0 for the first segment. RL.OptimStepOperation: type: object description: Async optimizer step operation @@ -9204,7 +15925,7 @@ components: oneOf: - type: string - type: integer - example: '100' + example: "100" RL.SampleResult: type: object description: Result of a sample operation @@ -9217,6 +15938,12 @@ components: type: object $ref: '#/components/schemas/RL.SampleRollout' description: Completions grouped by prompt + policy_segments: + type: array + items: + type: object + $ref: '#/components/schemas/RL.PolicyVersionSegment' + description: Policy versions that produced the returned rollouts. Most rollouts carry a single segment `(version, start_token=0)`; longer rollouts may carry multiple segments when the policy was updated mid-generation. RL.SampleRollout: type: object description: Completions generated for a single prompt @@ -9229,6 +15956,16 @@ components: type: object $ref: '#/components/schemas/RL.SampleSequence' description: Completions generated for one prompt + prompt_logprobs: + type: array + example: + - -0.5 + - -1.2 + - -0.3 + items: + type: number + format: double + description: Teacher-forced log-probabilities for the prompt tokens, one per token after the first (log P(token_i | token_- - Type of the training session. Defaults to TRAINER_AND_GENERATOR when - unspecified. TRAINER_ONLY provisions only the trainer and rejects - sample requests. + resume_from_hf_checkpoint: + description: HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id. + type: string + example: your-org/llama-3-8b-finetuned lora_config: $ref: '#/components/schemas/RL.LoraConfig' - RL.SessionType: - description: >- - Type of a training session. TRAINER_AND_GENERATOR provisions both - trainer and generator; TRAINER_ONLY provisions only the trainer and - rejects generator-dependent operations such as sample. - default: SESSION_TYPE_UNSPECIFIED - type: string - enum: - - SESSION_TYPE_UNSPECIFIED - - SESSION_TYPE_TRAINER_AND_GENERATOR - - SESSION_TYPE_TRAINER_ONLY + description: LoRA adapter configuration for the session + model_resources_id: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Model resource to attach the session to. The session runs on that resource's GPU pods. RL.TrainingSessionStatus: description: Status of the training session default: TRAINING_SESSION_STATUS_UNSPECIFIED @@ -9378,20 +16210,49 @@ components: - TRAINING_SESSION_STATUS_STOPPING - TRAINING_SESSION_STATUS_ERROR - TRAINING_SESSION_STATUS_EXPIRED + RL.TrainingSessionError: + type: object + description: Structured detail for the training session's current error + required: + - code + - message + - occurred_at + properties: + code: + $ref: '#/components/schemas/RL.TrainingSessionErrorCode' + example: TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY + description: Finite machine-readable reason code for UI branching + message: + type: string + example: The session could not start because the selected resource has no available capacity. + description: User-safe human-readable detail for the current status + occurred_at: + type: string + format: date-time + example: "2026-01-02T00:00:05Z" + description: Timestamp when this error was reported + RL.TrainingSessionErrorCode: + type: string + description: Finite machine-readable training session lifecycle error code + enum: + - TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE + - TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY + - TRAINING_SESSION_ERROR_CODE_TIMED_OUT + - TRAINING_SESSION_ERROR_CODE_SESSION_FAILED RL.TrainingSession: type: object description: A training session and its current state required: - id - status - - base_model - inference_checkpoints - training_checkpoints - step - created_at - updated_at - lora_config - - type + - model_resources_id + - created_by properties: id: type: string @@ -9401,10 +16262,9 @@ components: $ref: '#/components/schemas/RL.TrainingSessionStatus' example: TRAINING_SESSION_STATUS_RUNNING description: Status of the training session - base_model: - type: string - example: meta-llama/Meta-Llama-3-8B-Instruct - description: Base model used for the training session + error: + $ref: '#/components/schemas/RL.TrainingSessionError' + description: Structured detail for the training session's current error. Set when the session is in an error state. inference_checkpoints: type: array items: @@ -9426,27 +16286,29 @@ components: oneOf: - type: string - type: integer - example: '100' - default: '0' + example: "100" + default: "0" created_at: type: string format: date-time - example: '2026-01-02T00:00:00Z' + example: "2026-01-02T00:00:00Z" description: Timestamp when the training session was created updated_at: type: string format: date-time - example: '2026-01-02T00:00:05Z' + example: "2026-01-02T00:00:05Z" description: Timestamp when the training session was last updated lora_config: $ref: '#/components/schemas/RL.LoraConfig' - type: - $ref: '#/components/schemas/RL.SessionType' - example: SESSION_TYPE_TRAINER_AND_GENERATOR - description: >- - Type of the training session. TRAINER_AND_GENERATOR provisions both - trainer and generator; TRAINER_ONLY provisions only the trainer and - rejects generator-dependent operations such as sample. + description: LoRA adapter configuration for this session + model_resources_id: + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + description: Model resource this session is attached to. The session runs on that resource's GPU pods. + created_by: + type: string + example: user_123 + description: ID of the user who created the training session RL.TrainingSessionsListResponse: type: object description: Paginated list of training sessions @@ -9460,63 +16322,127 @@ components: meta: $ref: '#/components/schemas/RL.ListMeta' description: Pagination metadata + RL.SupportedModelsListResponse: + type: object + description: List of base models supported by the RL service + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/RL.SupportedModel' + description: Supported base models for RL RL.LoraConfig: type: object description: LoRA adapter configuration properties: rank: type: integer - format: int64 - example: 8 - default: '8' + + example: 32 + default: "32" description: Rank of the LoRA adapter alpha: type: integer - format: int64 - example: 16 - default: '16' + + example: 64 + default: "64" description: Alpha of the LoRA adapter dropout: type: number - format: float - example: 0.05 - default: '0.05' + example: 0 + default: "0.0" description: Dropout of the LoRA adapter enable: type: boolean example: true - default: 'true' - description: >- - Whether to enable LoRA fine-tuning. If false, full fine-tuning is - used. + default: "true" + description: Whether to enable LoRA fine-tuning. If false, full fine-tuning is used. + RL.OptimizerConfig: + type: object + description: Optimizer configuration + properties: + adamw: + $ref: '#/components/schemas/RL.AdamWOptimizerConfig' + description: Use the AdamW optimizer. + muon: + $ref: '#/components/schemas/RL.MuonOptimizerConfig' + description: Use the Muon optimizer. + RL.AdamWOptimizerConfig: + type: object + description: AdamW optimizer configuration + RL.MuonOptimizerConfig: + type: object + description: Advanced configuration for the Muon optimizer. + properties: + scaling_strategy: + $ref: '#/components/schemas/RL.MuonScalingStrategy' + example: MUON_SCALING_STRATEGY_ORIGINAL + default: MUON_SCALING_STRATEGY_MATCH_ADAMW + description: Scaling strategy for the Muon optimizer. + RL.MuonScalingStrategy: + type: string + enum: + - MUON_SCALING_STRATEGY_UNSPECIFIED + - MUON_SCALING_STRATEGY_MATCH_ADAMW + - MUON_SCALING_STRATEGY_ORIGINAL + default: MUON_SCALING_STRATEGY_UNSPECIFIED RL.AdamWOptimizerParams: - description: AdamW optimizer parameters + description: Per-step AdamW optimizer overrides. type: object properties: + learning_rate: + description: Learning rate for the AdamW-tuned parameters + type: number + example: 0.0001 beta1: - description: First moment decay rate + description: Exponential decay rate for the first-moment estimate type: number - format: float example: 0.9 - default: '0.9' + default: "0.9" beta2: - description: Second moment decay rate + description: Exponential decay rate for the second-moment estimate type: number - format: float example: 0.95 - default: '0.95' + default: "0.95" eps: description: Epsilon for numerical stability type: number - format: float - example: 1.e-8 - default: '1e-8' + example: 1e-08 + default: "1e-8" weight_decay: description: Weight decay coefficient type: number - format: float example: 0.1 - default: '0.1' + default: "0" + RL.MuonOptimizerParams: + type: object + description: Per-step Muon optimizer overrides + properties: + learning_rate: + type: number + example: 0.02 + description: Learning rate for this Muon optimizer step. + momentum: + type: number + example: 0.95 + default: "0.95" + description: Momentum coefficient + newton_schulz_steps: + type: integer + + example: 5 + default: "5" + description: Number of Newton-Schulz iterations + weight_decay: + type: number + example: 0 + default: "0.0" + description: Weight decay coefficient + adamw: + $ref: '#/components/schemas/RL.AdamWOptimizerParams' + description: Per-step AdamW optimizer overrides for the AdamW-tuned parameters in a Muon-tuned optimizer session. RL.InferenceCheckpointOperation: type: object description: Async inference checkpoint operation @@ -9564,12 +16490,12 @@ components: oneOf: - type: string - type: integer - example: '42' + example: "42" description: Training step at time of save created_at: type: string format: date-time - example: '2026-01-02T00:00:00Z' + example: "2026-01-02T00:00:00Z" description: Timestamp when the checkpoint was created registration: $ref: '#/components/schemas/RL.InferenceCheckpointRegistration' @@ -9588,7 +16514,7 @@ components: registered_at: type: string format: date-time - example: '2026-01-02T00:00:00Z' + example: "2026-01-02T00:00:00Z" description: Timestamp when the model was registered RL.TrainingCheckpoint: type: object @@ -9606,12 +16532,12 @@ components: oneOf: - type: string - type: integer - example: '42' + example: "42" description: Training step at time of save created_at: type: string format: date-time - example: '2026-01-02T00:00:00Z' + example: "2026-01-02T00:00:00Z" description: Timestamp when the checkpoint was created RL.TrainingCheckpointResult: type: object @@ -9651,7 +16577,7 @@ components: - CHECKPOINT_VARIANT_MERGED - CHECKPOINT_VARIANT_ADAPTER default: CHECKPOINT_VARIANT_UNSPECIFIED - description: 'Checkpoint variant: merged (full model) or adapter (LoRA weights only)' + description: "Checkpoint variant: merged (full model) or adapter (LoRA weights only)" RL.CheckpointFile: type: object description: A downloadable file within a checkpoint @@ -9666,13 +16592,13 @@ components: description: Name of the file url: type: string - example: https://... + example: "https://..." description: Presigned URL for downloading the file size: oneOf: - type: string - type: integer - example: '123456789' + example: "123456789" description: File size in bytes RL.CheckpointDownloadResponse: type: object @@ -9697,7 +16623,6 @@ components: type: object required: - node_id - - node_name - status - host_name - num_cpu_cores @@ -9707,8 +16632,6 @@ components: properties: node_id: type: string - node_name: - type: string status: type: string host_name: @@ -9717,7 +16640,6 @@ components: type: integer memory_gib: type: number - format: float network: type: string phase_transitions: @@ -9725,6 +16647,9 @@ components: items: $ref: '#/components/schemas/NodePhaseTransition' description: Phase transition history for this control plane node. + public_ipv4: + type: string + description: Public IPv4 address of the control plane node. GPUClusterCreateRequest: description: GPU Cluster create request required: @@ -9740,13 +16665,9 @@ components: cluster_type: description: Type of cluster to create. type: string - enum: - - KUBERNETES - - SLURM + enum: [KUBERNETES, SLURM] region: - description: >- - Region to create the GPU cluster in. Usable regions can be found - from `client.clusters.list_regions()` + description: Region to create the GPU cluster in. Usable regions can be found from `client.clusters.list_regions()` type: string gpu_type: description: Type of GPU to use in the cluster @@ -9759,11 +16680,8 @@ components: - B200_SXM - H100_SXM_INF num_gpus: - description: >- - Number of GPUs to allocate in the cluster. This must be multiple of - 8. For example, 8, 16 or 24 + description: Number of GPUs to allocate in the cluster. This must be multiple of 8. For example, 8, 16 or 24 type: integer - format: int32 cluster_name: description: Name of the GPU cluster. type: string @@ -9774,87 +16692,53 @@ components: shared_volume: x-stainless-terraform-configurability: computed $ref: '#/components/schemas/GPUClustersSharedVolumeCreateRequest' - description: >- - Inline configuration to create a shared volume with the cluster - creation. + description: Inline configuration to create a shared volume with the cluster creation. volume_id: description: ID of an existing volume to use with the cluster creation. type: string billing_type: - description: > - RESERVED billing types allow you to specify the duration of the - cluster reservation via the duration_days field. - - ON_DEMAND billing types will give you ownership of the cluster until - you delete it. - - SCHEDULED_CAPACITY billing types allow you to reserve capacity for a - scheduled time window. You must specify the reservation_start_time - and reservation_end_time with this request. + description: | + RESERVED billing types allow you to specify the duration of the cluster reservation via the duration_days field. + ON_DEMAND billing types will give you ownership of the cluster until you delete it. + SCHEDULED_CAPACITY billing types allow you to reserve capacity for a scheduled time window. You must specify the reservation_start_time and reservation_end_time with this request. x-stainless-terraform-configurability: computed type: string enum: - RESERVED - ON_DEMAND - SCHEDULED_CAPACITY - gpu_node_failover_enabled: - type: boolean - default: false - description: >- - Whether automated GPU node failover should be enabled for this - cluster. By default, it is disabled. auto_scaled: deprecated: true type: boolean default: false - description: >- - Whether GPU cluster should be auto-scaled based on the workload. By - default, it is not auto-scaled. + description: Whether GPU cluster should be auto-scaled based on the workload. By default, it is not auto-scaled. auto_scale_max_gpus: type: integer - description: >- - Maximum number of GPUs to which the cluster can be auto-scaled up. - This field is required if auto_scaled is true. + description: Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. slurm_shm_size_gib: type: integer - description: >- - Shared memory size in GiB for Slurm cluster. This field is required - if cluster_type is SLURM. + description: Shared memory size in GiB for Slurm cluster. This field is required if cluster_type is SLURM. capacity_pool_id: type: string - description: >- - ID of the capacity pool to use for the cluster. This field is - optional and only applicable if the cluster is created from a - capacity pool. + description: ID of the capacity pool to use for the cluster. This field is optional and only applicable if the cluster is created from a capacity pool. reservation_start_time: type: string - description: >- - Reservation start time of the cluster. This field is required for - SCHEDULED billing to specify the reservation start time for the - cluster. If not provided, the cluster provisions immediately. + description: Reservation start time of the cluster. This field is required for SCHEDULED billing to specify the reservation start time for the cluster. If not provided, the cluster provisions immediately. format: date-time reservation_end_time: type: string - description: >- - Reservation end time of the cluster. This field is required for - SCHEDULED billing to specify the reservation end time for the - cluster. + description: Reservation end time of the cluster. This field is required for SCHEDULED billing to specify the reservation end time for the cluster. format: date-time install_traefik: type: boolean default: false - description: >- - Whether to install Traefik ingress controller in the cluster. This - field is only applicable for Kubernetes clusters and is false by - default. + description: Whether to install Traefik ingress controller in the cluster. This field is only applicable for Kubernetes clusters and is false by default. cuda_version: type: string description: CUDA version for this cluster. For example, 12.5 nvidia_driver_version: type: string - description: >- - Nvidia driver version for this cluster. For example, 550. Only some - combination of cuda_version and nvidia_driver_version are supported. + description: Nvidia driver version for this cluster. For example, 550. Only some combination of cuda_version and nvidia_driver_version are supported. slurm_image: type: string description: Custom Slurm image for Slurm clusters. @@ -9862,40 +16746,23 @@ components: $ref: '#/components/schemas/OIDCConfig' project_id: type: string - description: >- - Project ID for the cluster. If not set, the project from the request - context is used. + description: Project ID for the cluster. If not set, the project from the request context is used. acceptance_tests_params: $ref: '#/components/schemas/AcceptanceTestsParams' cluster_config: $ref: '#/components/schemas/InstanceClusterConfig' num_capacity_pool_gpus: type: integer - description: >- - Number of GPUs to allocate from the capacity pool. Must be a - multiple of 8 and not exceed num_gpus. - format: int32 + description: Number of GPUs to allocate from the capacity pool. Must be a multiple of 8 and not exceed num_gpus. auto_scale: type: boolean - description: >- - Whether to enable auto-scaling for the cluster. If true, the cluster - will automatically scale the number of GPU worker nodes between - num_gpus and auto_scale_max_gpus based on the workload. + description: Whether to enable auto-scaling for the cluster. If true, the cluster will automatically scale the number of GPU worker nodes between num_gpus and auto_scale_max_gpus based on the workload. num_preemptible_gpus: type: integer - description: >- - Number of preemptible GPUs to request alongside on-demand capacity. - Must be a multiple of 8. Preemptible nodes are cheaper but may be - reclaimed when on-demand capacity is needed elsewhere; the system - fulfills this asynchronously and surfaces the actual count in - allocated_preemptible_gpus. - format: int32 + description: Number of preemptible GPUs to request alongside on-demand capacity. Must be a multiple of 8. Preemptible nodes are cheaper but may be reclaimed when on-demand capacity is needed elsewhere; the system fulfills this asynchronously and surfaces the actual count in allocated_preemptible_gpus. num_reserved_gpus: type: integer - description: >- - Number of prepaid (PLG) reserved GPUs for this cluster. When omitted - for RESERVED billing on create, the server defaults this to - num_gpus. + description: Number of prepaid (PLG) reserved GPUs for this cluster. When omitted for RESERVED billing on create, the server defaults this to num_gpus. add_ons: type: array items: @@ -9905,7 +16772,6 @@ components: type: object required: - node_id - - node_name - status - host_name - num_cpu_cores @@ -9916,8 +16782,6 @@ components: properties: node_id: type: string - node_name: - type: string status: type: string host_name: @@ -9928,7 +16792,6 @@ components: type: integer memory_gib: type: number - format: float networks: type: array items: @@ -9944,6 +16807,34 @@ components: items: $ref: '#/components/schemas/NodePhaseTransition' description: Phase transition history for this GPU worker node. + marked_for_deletion: + type: boolean + description: Whether this node is marked for deletion by the operator. + public_ipv4: + type: string + description: Public IPv4 address of the GPU worker node. + ib_hca_type: + type: string + description: InfiniBand HCA type. + ib_hca_count: + type: integer + description: Number of InfiniBand HCAs. + nvswitch_count: + type: integer + description: Number of NVSwitches. + nvswitch_type: + type: string + description: NVSwitch type. + ephemeral_storage: + type: string + description: Ephemeral storage size, such as 1Ti. + auto_remediation_enabled: + type: boolean + description: Whether auto-remediation is enabled for this node's instance. + deleted_at: + type: string + description: Timestamp when the node left the live data plane. Only set for deleted_gpu_worker_nodes. + format: date-time GPUClusterInfo: type: object required: @@ -9965,6 +16856,8 @@ components: - phase_transitions - desired_preemptible_gpus - allocated_preemptible_gpus + - num_capacity_pool_gpus + - num_reserved_gpus - billing_type - add_ons properties: @@ -9972,9 +16865,7 @@ components: type: string cluster_type: description: Type of cluster. - enum: - - KUBERNETES - - SLURM + enum: [KUBERNETES, SLURM] region: type: string gpu_type: @@ -10019,7 +16910,6 @@ components: type: string num_gpus: type: integer - format: int32 slurm_shm_size_gib: type: integer capacity_pool_id: @@ -10048,7 +16938,6 @@ components: num_cpu_workers: type: integer description: Number of CPU-only worker nodes in the cluster. - format: int32 phase_transitions: type: array items: @@ -10056,74 +16945,117 @@ components: description: Cluster-level phase transition history. desired_preemptible_gpus: type: integer - description: >- - Customer's requested number of preemptible GPUs. Set on cluster - create or update; persists until changed. - format: int32 + description: Customer's requested number of preemptible GPUs. Set on cluster create or update; persists until changed. allocated_preemptible_gpus: type: integer - description: >- - Actual number of preemptible GPUs currently allocated to the - cluster. Updated asynchronously by the fulfillment and reclamation - workers; may be less than desired_preemptible_gpus when capacity is - constrained. - format: int32 + description: Actual number of preemptible GPUs currently allocated to the cluster. Updated asynchronously by the fulfillment and reclamation workers; may be less than desired_preemptible_gpus when capacity is constrained. billing_type: enum: - RESERVED - ON_DEMAND - SCHEDULED_CAPACITY type: string - description: >- - Billing type for the cluster (RESERVED, ON_DEMAND, or - SCHEDULED_CAPACITY). + description: Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY). add_ons: type: array items: $ref: '#/components/schemas/AddOnInfo' - description: >- - Enabled add-ons on this cluster. Only add-ons with enabled=true in - their config are returned. + description: Enabled add-ons on this cluster. Only add-ons with enabled=true in their config are returned. + machine_cluster_id: + type: string + description: ID of the machine cluster backing this GPU cluster. + first_ready_at: + type: string + description: Timestamp when the cluster first reached the Ready phase. + format: date-time + is_in_substrate: + type: boolean + description: Whether the cluster is managed inside a substrate environment. + control_plane_ready: + type: boolean + description: Whether the control plane is currently ready. + ums_project_id: + type: string + description: UMS project ID associated with this cluster. + ums_org_id: + type: string + description: UMS organization ID associated with this cluster. + os_image: + type: string + description: Data-volume image name for GPU worker nodes. + nvidia_driver_version_id: + type: string + description: Internal NVIDIA version ID for this cluster's driver and CUDA combination. + num_capacity_pool_gpus: + type: integer + description: Number of GPUs to draw from a capacity pool. A component of the overall num_gpus, alongside num_reserved_gpus. + format: int32 + num_reserved_gpus: + type: integer + description: Number of prepaid reserved GPUs for this cluster. A component of the overall num_gpus, alongside num_capacity_pool_gpus. + format: int32 + deleted_gpu_worker_nodes: + type: array + items: + $ref: '#/components/schemas/GPUClusterGPUWorkerNode' + description: GPU worker nodes retained after they left the live data plane. These are separate from gpu_worker_nodes and must not be counted as live capacity. + node_lifecycle_events: + type: array + items: + $ref: '#/components/schemas/GPUClusterNodeLifecycleEvent' + description: Recent node lifecycle events such as scale-up, scale-down, and preemption. Combine these with live and deleted node lists to render the cluster timeline. + GPUClusterNodeLifecycleEvent: + type: object + description: Node lifecycle event included in a GPU cluster timeline. + required: + - node_id + - reason + - message + - timestamp + properties: + node_id: + type: string + description: Tenant node name this lifecycle event applies to. + reason: + type: string + description: Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or TogetherPreempted. + message: + type: string + description: Human-readable lifecycle event message. + timestamp: + type: string + description: Event timestamp. + format: date-time GPUClusterUpdateRequest: type: object properties: cluster_type: description: Type of cluster to update. - enum: - - KUBERNETES - - SLURM + enum: [KUBERNETES, SLURM] num_gpus: - description: >- - Target GPU count for the cluster. When omitted, the server keeps the - current GPU count from cluster metadata (use for config-only or - decommission-time-only updates). + description: Target GPU count for the cluster. When omitted, the server keeps the current GPU count from cluster metadata (use for config-only or decommission-time-only updates). type: integer reservation_end_time: type: string - description: >- - Timestamp at which the cluster should be decommissioned. Only - accepted for prepaid clusters. + description: Timestamp at which the cluster should be decommissioned. Only accepted for prepaid clusters. format: date-time cluster_config: $ref: '#/components/schemas/InstanceClusterConfig' num_reserved_gpus: type: integer - description: >- - Number of reserved GPUs to update to. This field is only applicable - for clusters with RESERVED billing type. + description: Number of reserved GPUs to update to. This field is only applicable for clusters with RESERVED billing type. num_preemptible_gpus: type: integer - description: >- - Updated desired number of preemptible GPUs for the cluster. When - omitted, the current value is preserved. Must be a multiple of 8. + description: Updated desired number of preemptible GPUs for the cluster. When omitted, the current value is preserved. Must be a multiple of 8. + num_capacity_pool_gpus: + type: integer + description: Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved. format: int32 add_ons: type: array items: $ref: '#/components/schemas/AddOnUpdateRequest' - description: >- - Add-ons to update on the cluster. Each entry identifies an existing - add-on by name and provides the new external config to merge. + description: Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge. GPUClusterVolume: type: object required: @@ -10146,8 +17078,7 @@ components: description: Current status of the volume. GPUClusters: type: object - required: - - clusters + required: [clusters] properties: clusters: type: array @@ -10170,8 +17101,7 @@ components: $ref: '#/components/schemas/ErrorResponse' RegionListResponse: type: object - required: - - regions + required: [regions] properties: regions: type: array @@ -10186,9 +17116,7 @@ components: description: Identifiable name of the region. type: string driver_versions: - description: >- - List of supported identifiable cuda/nvidia driver versions - pairs available in the region. + description: List of supported identifiable cuda/nvidia driver versions pairs available in the region. type: array items: $ref: '#/components/schemas/ClusterDriverVersionInfo' @@ -10199,9 +17127,7 @@ components: type: string ClusterDriverVersionInfo: type: object - description: >- - CUDA/NVIDIA driver versions pair available in the region to use in the - create cluster request. + description: CUDA/NVIDIA driver versions pair available in the region to use in the create cluster request. required: - cuda_version - nvidia_driver_version @@ -10225,14 +17151,10 @@ components: - DCGM_DIAG_LEVEL_LONG - DCGM_DIAG_LEVEL_EXTENDED type: string - description: >- - DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = - system validation; EXTENDED = memtest. An omitted value selects - MEDIUM when enabled. + description: DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = system validation; EXTENDED = memtest. An omitted value selects MEDIUM when enabled. gpu_burn_duration: type: integer description: GPU burn duration in seconds; 0 means use the default when enabled. - format: int32 nccl_single_node_skipped: type: boolean description: Skip NCCL single-node acceptance test. @@ -10245,9 +17167,10 @@ components: nccl_multi_node_skipped: type: boolean description: Skip NCCL multi-node acceptance test. - description: >- - AcceptanceTestsParams groups all GPU acceptance test options when - enabled is true. + storage_skipped: + type: boolean + description: Skip storage-performance acceptance test. + description: AcceptanceTestsParams groups all GPU acceptance test options when enabled is true. AddOnConfig: type: object properties: @@ -10255,6 +17178,16 @@ components: $ref: '#/components/schemas/DashboardConfig' ingress: $ref: '#/components/schemas/IngressConfig' + torchpass: + description: Configuration for the Model Aware TorchPass add-on. + $ref: '#/components/schemas/TorchpassConfig' + slurm_web: + description: Configuration for the Slurm Web add-on. + $ref: '#/components/schemas/SlurmWebConfig' + headlamp: + description: Configuration for the Headlamp Kubernetes dashboard add-on. + $ref: '#/components/schemas/HeadlampConfig' + description: Configuration for a cluster add-on. AddOnCreateRequest: type: object required: @@ -10266,7 +17199,7 @@ components: description: Human-readable name for this add-on instance. add_on_type: type: string - description: 'Type of add-on. Valid values: ''dashboard'', ''ingress''.' + description: 'Type of add-on. Valid values: ''dashboard'', ''ingress'', ''torchpass''.' config: $ref: '#/components/schemas/AddOnConfig' AddOnInfo: @@ -10293,6 +17226,16 @@ components: $ref: '#/components/schemas/DashboardState' ingress: $ref: '#/components/schemas/IngressState' + torchpass: + description: State for the Model Aware TorchPass add-on. + $ref: '#/components/schemas/TorchpassState' + slurm_web: + description: State for the Slurm Web add-on. + $ref: '#/components/schemas/SlurmWebState' + headlamp: + description: State for the Headlamp Kubernetes dashboard add-on. + $ref: '#/components/schemas/HeadlampState' + description: State for a cluster add-on. AddOnUpdateRequest: type: object required: @@ -10300,9 +17243,7 @@ components: properties: name: type: string - description: >- - Name of the add-on to update. Must match an existing add-on on the - cluster. + description: Name of the add-on to update. Must match an existing add-on on the cluster. config: $ref: '#/components/schemas/AddOnConfig' CommentBody: @@ -10311,6 +17252,29 @@ components: comment: type: string description: Comment explaining the action. + ApproveRemediationRequest: + type: object + description: Request body for approving a pending remediation. + properties: + comment: + type: string + description: Approval comment explaining the decision. + mode: + enum: + - REMEDIATION_MODE_VM_ONLY + - REMEDIATION_MODE_HOST_AWARE + - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT + - REMEDIATION_MODE_REBOOT_VM + - REMEDIATION_MODE_HOST_POWER_CYCLE + type: string + description: | + Remediation mode to use after approval. When omitted, the remediation keeps its existing mode. + + - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host. + - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement. + - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place. + - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly. ClusterAddOnCreateRequest: type: object required: @@ -10319,8 +17283,10 @@ components: properties: name: type: string + description: Human-readable name for this add-on instance. add_on_type: type: string + description: 'Type of add-on. Valid values: ''dashboard'', ''ingress'', ''torchpass'', ''headlamp''.' config: $ref: '#/components/schemas/AddOnConfig' ClusterAddOnDeleteResponse: @@ -10388,6 +17354,19 @@ components: properties: {} additionalProperties: false x-stainless-empty-object: true + HeadlampConfig: + type: object + properties: + enabled: + type: boolean + description: Whether to enable the Headlamp Kubernetes dashboard add-on. + description: Configuration for the Headlamp Kubernetes dashboard cluster add-on. + HeadlampState: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Runtime state for the Headlamp Kubernetes dashboard cluster add-on. GPUClusterDeleteResponse: type: object required: @@ -10405,6 +17384,32 @@ components: properties: {} additionalProperties: false x-stainless-empty-object: true + TorchpassConfig: + type: object + properties: + enabled: + type: boolean + description: Whether to enable the Model Aware TorchPass add-on. + description: Configuration for the Model Aware TorchPass cluster add-on. + TorchpassState: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Runtime state for the Model Aware TorchPass cluster add-on. + SlurmWebConfig: + type: object + properties: + enabled: + type: boolean + description: Whether to enable the Slurm Web add-on. + description: Configuration for the Slurm Web cluster add-on. + SlurmWebState: + type: object + properties: {} + additionalProperties: false + x-stainless-empty-object: true + description: Runtime state for the Slurm Web cluster add-on. InstanceClusterConfig: type: object required: @@ -10429,9 +17434,13 @@ components: $ref: '#/components/schemas/ObservabilityConfig' gpu_operator_version: type: string - description: >- - NVIDIA GPU Operator chart/version for the tenant cluster (e.g. - v24.6.2). When omitted, a service default is applied. + description: NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When omitted, a service default is applied. + network_operator_version: + type: string + description: NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0). When omitted, a service default is applied. + ssh_ca_enabled: + type: boolean + description: Whether this cluster uses a per-cluster SSH certificate authority for OIDC-signed SSH access. ListRemediationsResponse: type: object required: @@ -10485,9 +17494,7 @@ components: properties: issuer_url: type: string - description: >- - OIDC issuer URL for authentication. For example, - https://accounts.google.com + description: OIDC issuer URL for authentication. For example, https://accounts.google.com client_id: type: string description: OIDC client ID for authentication. @@ -10496,28 +17503,96 @@ components: description: JWT claim to use as the username. For example, 'sub' or 'email' username_prefix: type: string - description: >- - Prefix to add to the username claim to form the final username. For - example, 'oidc:' + description: Prefix to add to the username claim to form the final username. For example, 'oidc:' group_claim: type: string description: JWT claim to use for user groups. For example, 'groups' group_prefix: type: string - description: >- - Prefix to add to the group claim to form the final group name. For - example, 'oidc:' + description: Prefix to add to the group claim to form the final group name. For example, 'oidc:' ca_cert: type: string - description: >- - CA certificate in PEM format to validate the OIDC issuer's TLS - certificate. This field is optional but recommended if the issuer - uses a private CA or self-signed certificate. + description: CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This field is optional but recommended if the issuer uses a private CA or self-signed certificate. ObservabilityConfig: type: object properties: enabled: type: boolean + ListPassiveHealthCheckAlertsResponse: + type: object + required: + - alerts + - next_page_token + properties: + alerts: + type: array + items: + $ref: '#/components/schemas/PassiveHealthCheckAlert' + description: Alerts on the current page, ordered by start time descending. + next_page_token: + type: string + description: Opaque token for the next page. Empty means there are no more pages. + description: Response returned when listing passive health check alerts. + PassiveHealthCheckAlert: + type: object + required: + - passive_health_check_alert_id + - cluster_id + - target_vm + - alert_name + - severity + - annotations + - started_at + properties: + passive_health_check_alert_id: + readOnly: true + type: string + description: Primary key UUID for the passive health check alert. + instance_id: + readOnly: true + type: string + description: Resolved instance UUID. Empty until the alert is joined to an instance. + cluster_id: + readOnly: true + type: string + description: Cluster UUID the alert was raised against. + target_vm: + readOnly: true + type: string + description: VM name extracted from the Alertmanager labels. + alert_name: + readOnly: true + type: string + description: Alertmanager alert name. + severity: + readOnly: true + enum: + - PHC_SEVERITY_INFO + - PHC_SEVERITY_WARNING + - PHC_SEVERITY_CRITICAL + type: string + description: Canonical severity tier for the alert. + annotations: + readOnly: true + type: object + additionalProperties: + type: string + description: Alertmanager annotations as key-value strings. + started_at: + readOnly: true + type: string + description: Time when the underlying alert first fired. + format: date-time + resolved_at: + readOnly: true + type: string + description: Time when the underlying alert resolved. Empty while the alert is firing. + format: date-time + node_remediation_intent_id: + readOnly: true + type: string + description: Remediation intent UUID attached to this alert, if any. + description: Passive health check alert returned by the health check API. Remediation: type: object required: @@ -10543,31 +17618,27 @@ components: - REMEDIATION_MODE_HOST_AWARE - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT - REMEDIATION_MODE_REBOOT_VM + - REMEDIATION_MODE_HOST_POWER_CYCLE type: string - description: > + description: | Remediation mode specifies how the remediation should be performed. - - - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new - one on any available host. - - - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, - and provisions a new one on a different host. + - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host. + - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host. + - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement. + - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place. + - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity. trigger: readOnly: true enum: - REMEDIATION_TRIGGER_MANUAL - REMEDIATION_TRIGGER_AUTOMATED type: string - description: > + description: | RemediationTrigger specifies how the remediation was triggered. - - - `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either - via web UI or API call). - - - `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation - that requires approval. + - `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI or API call). + - `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires approval. state: readOnly: true enum: @@ -10578,25 +17649,21 @@ components: - FAILED - CANCELLED - AUTO_RESOLVED + - QUARANTINING + - QUARANTINED type: string - description: > + description: | RemediationState represents the lifecycle state of a remediation. - - `PENDING_APPROVAL`: Awaiting approval before processing can begin. - - `PENDING`: Approved and queued for processing. - - `RUNNING`: Actively being processed. - - `SUCCEEDED`: Successfully completed. - - `FAILED`: Failed with an error. - - `CANCELLED`: Cancelled by user or system. - - - `AUTO_RESOLVED`: The underlying issue was automatically resolved - before processing. + - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing. + - `QUARANTINING`: Cordoning or preparing the host before remediation. + - `QUARANTINED`: Host has been cordoned or isolated for remediation. reason: type: string description: User-provided reason for the remediation. @@ -10649,11 +17716,19 @@ components: type: string description: When the remediation was last updated. format: date-time - description: >- + instance_name: + readOnly: true + type: string + description: Display name of the targeted instance. + linked_alerts: + readOnly: true + type: array + items: + $ref: '#/components/schemas/PassiveHealthCheckAlert' + description: Passive health check alerts linked to this remediation, including resolved alerts. + description: |- Remediation represents a node remediation request for an instance. - - An instance can have multiple remediations over time (e.g., failed - attempts followed by retries). + An instance can have multiple remediations over time (e.g., failed attempts followed by retries). GPUClustersSharedVolumeCreateRequest: type: object required: @@ -10669,14 +17744,13 @@ components: description: Volume size in whole tebibytes (TiB). region: type: string - description: >- - Region name. Usable regions can be found from - `clusters.list_regions()` + description: Region name. Usable regions can be found from `clusters.list_regions()` is_lifecycle_independent: type: boolean - description: >- - When true, the shared volume is not deleted when the cluster is - decommissioned. + description: When true, the shared volume is not deleted when the cluster is decommissioned. + project_id: + type: string + description: Project ID that will own the volume. When omitted, the caller's default project is used. GPUClustersSharedVolumeDeleteResponse: type: object required: @@ -10757,68 +17831,63 @@ components: extra_slurm_conf: type: string description: Additional slurm.conf fragments. - description: >- - SlurmStartupScripts carries optional Slurm lifecycle scripts - (prolog/epilog, init, extra conf). + description: SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf). ListVoicesResponse: description: Response containing a list of models and their available voices. type: object - required: - - data + required: ['data'] properties: data: type: array items: $ref: '#/components/schemas/ModelVoices' + ModelVoices: description: Represents a model with its available voices. type: object - required: - - model - - voices + required: ['model', 'voices'] properties: model: description: Model name. type: string + voices: description: List of available voices for the model. type: array items: type: object - required: - - id - - name + required: ['id', 'name'] properties: id: type: string name: description: Voice name to be used for audio inference. type: string + ListAvailibilityZonesResponse: description: List of unique availability zones type: object - required: - - avzones + required: ['avzones'] properties: avzones: type: array items: type: string + RerankRequest: type: object properties: model: type: string description: > - The model to be used for the rerank request.

[See all of - Together AI's rerank - models](https://docs.together.ai/docs/serverless-models#rerank-models) + The model to be used for the rerank request.

[See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models) example: Salesforce/Llama-Rank-V1 anyOf: - type: string enum: - Salesforce/Llama-Rank-v1 - type: string + query: type: string description: The search query to be used for ranking. @@ -10833,29 +17902,12 @@ components: - type: array items: type: string - example: >- - Our solar system orbits the Milky Way galaxy at about 515,000 - mph + example: Our solar system orbits the Milky Way galaxy at about 515,000 mph example: - - title: Llama - text: >- - The llama is a domesticated South American camelid, widely used - as a meat and pack animal by Andean cultures since the - pre-Columbian era. - - title: Panda - text: >- - The giant panda (Ailuropoda melanoleuca), also known as the - panda bear or simply panda, is a bear species endemic to China. - - title: Guanaco - text: >- - The guanaco is a camelid native to South America, closely - related to the llama. Guanacos are one of two wild South - American camelids; the other species is the vicuña, which lives - at higher elevations. - - title: Wild Bactrian camel - text: >- - The wild Bactrian camel (Camelus ferus) is an endangered species - of camel endemic to Northwest China and southwestern Mongolia. + - {'title': 'Llama', 'text': 'The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era.'} + - {'title': 'Panda', 'text': 'The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.'} + - {'title': 'Guanaco', 'text': 'The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations.'} + - {'title': 'Wild Bactrian camel', 'text': 'The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.'} top_n: type: integer description: The number of top results to return. @@ -10868,17 +17920,14 @@ components: type: array items: type: string - description: >- - List of keys in the JSON Object document to rank by. Defaults to use - all supplied keys for ranking. - example: - - title - - text + description: List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking. + example: ['title', 'text'] required: - model - query - documents additionalProperties: false + RerankResponse: type: object required: @@ -10901,10 +17950,7 @@ components: type: array items: type: object - required: - - index - - relevance_score - - document + required: [index, relevance_score, document] properties: index: type: integer @@ -10917,27 +17963,12 @@ components: type: string nullable: true example: - - index: 0 - relevance_score: 0.29980177813003117 - document: - text: >- - {"title":"Llama","text":"The llama is a domesticated South - American camelid, widely used as a meat and pack animal by - Andean cultures since the pre-Columbian era."} - - index: 2 - relevance_score: 0.2752447527354349 - document: - text: >- - {"title":"Guanaco","text":"The guanaco is a camelid native to - South America, closely related to the llama. Guanacos are one - of two wild South American camelids; the other species is the - vicuña, which lives at higher elevations."} + - {'index': 0, 'relevance_score': 0.29980177813003117, 'document': {'text': '{"title":"Llama","text":"The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."}'}} + - {'index': 2, 'relevance_score': 0.2752447527354349, 'document': {'text': '{"title":"Guanaco","text":"The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."}'}} usage: $ref: '#/components/schemas/UsageData' - example: - prompt_tokens: 1837 - completion_tokens: 0 - total_tokens: 1837 + example: {'prompt_tokens': 1837, 'completion_tokens': 0, 'total_tokens': 1837} + ErrorData: type: object required: @@ -10963,6 +17994,7 @@ components: required: - type - message + FinishReason: type: string enum: @@ -10971,11 +18003,13 @@ components: - length - tool_calls - function_call + TopLogprobs: description: Top log probabilities for the tokens. type: object additionalProperties: type: number + LogprobsPart: type: object properties: @@ -10996,6 +18030,7 @@ components: description: List of token log probabilities top_logprobs: $ref: '#/components/schemas/TopLogprobs' + PromptPart: type: array items: @@ -11006,6 +18041,7 @@ components: example: [INST] What is the capital of France? [/INST] logprobs: $ref: '#/components/schemas/LogprobsPart' + InferenceWarning: type: object required: @@ -11013,6 +18049,7 @@ components: properties: message: type: string + UsageData: type: object properties: @@ -11027,6 +18064,7 @@ components: - completion_tokens - total_tokens nullable: true + CompletionChoicesData: type: array items: @@ -11034,19 +18072,14 @@ components: properties: text: type: string - example: >- - The capital of France is Paris. It's located in the north-central - part of the country and is one of the most populous and visited - cities in the world, known for its iconic landmarks like the - Eiffel Tower, Louvre Museum, Notre-Dame Cathedral, and more. Paris - is also the capital of the Île-de-France region and is a major - global center for art, fashion, gastronomy, and culture. + example: The capital of France is Paris. It's located in the north-central part of the country and is one of the most populous and visited cities in the world, known for its iconic landmarks like the Eiffel Tower, Louvre Museum, Notre-Dame Cathedral, and more. Paris is also the capital of the Île-de-France region and is a major global center for art, fashion, gastronomy, and culture. seed: type: integer finish_reason: $ref: '#/components/schemas/FinishReason' logprobs: $ref: '#/components/schemas/LogprobsPart' + CompletionRequest: type: object required: @@ -11060,9 +18093,7 @@ components: model: type: string description: > - The name of the model to query.

[See all of Together AI's - chat - models](https://docs.together.ai/docs/serverless-models#chat-models) + The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models) example: mistralai/Mixtral-8x7B-Instruct-v0.1 anyOf: - type: string @@ -11077,80 +18108,41 @@ components: description: The maximum number of tokens to generate. stop: type: array - description: >- - A list of string sequences that truncate (stop) inference text - output. For example, "
" stops generation as soon as the model - generates the given token. + description: A list of string sequences that truncate (stop) inference text output. For example, "" stops generation as soon as the model generates the given token. items: type: string temperature: type: number - description: >- - A decimal number from 0-1 that determines the degree of randomness - in the response. A temperature less than 1 favors more correctness - and is appropriate for question answering or summarization. A value - closer to 1 introduces more randomness in the output. - format: float + description: A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output. top_p: type: number - description: >- - A percentage (also called the nucleus parameter) that's used to - dynamically adjust the number of choices for each predicted token - based on the cumulative probabilities. It specifies a probability - threshold below which all less likely tokens are filtered out. This - technique helps maintain diversity and generate more fluent and - natural-sounding text. - format: float + description: A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text. top_k: type: integer - description: >- - An integer that's used to limit the number of choices for the next - predicted word or token. It specifies the maximum number of tokens - to consider at each step, based on their probability of occurrence. - This technique helps to speed up the generation process and can - improve the quality of the generated text by focusing on the most - likely options. - format: int32 + description: An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options. repetition_penalty: type: number - description: >- - A number that controls the diversity of generated text by reducing - the likelihood of repeated sequences. Higher values decrease - repetition. - format: float + description: A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition. stream: type: boolean - description: >- - If true, stream tokens as Server-Sent Events as the model generates - them instead of waiting for the full model response. The stream - terminates with `data: [DONE]`. If false, return a single JSON - object containing the results. + description: 'If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with `data: [DONE]`. If false, return a single JSON object containing the results.' logprobs: type: integer minimum: 0 maximum: 20 - description: >- - An integer between 0 and 20 of the top k tokens to return log - probabilities for at each generation step, instead of only the - sampled token. Log probabilities help assess model confidence in - token predictions. + description: An integer between 0 and 20 of the top k tokens to return log probabilities for at each generation step, instead of only the sampled token. Log probabilities help assess model confidence in token predictions. echo: type: boolean - description: >- - If true, the response contains the prompt. Can be used with - `logprobs` to return prompt logprobs. - 'n': + description: If true, the response contains the prompt. Can be used with `logprobs` to return prompt logprobs. + n: type: integer description: The number of completions to generate for each prompt. minimum: 1 maximum: 128 safety_model: type: string - description: >- - The name of the moderation model used to validate tokens. Choose - from the available moderation models found - [here](https://docs.together.ai/docs/inference-models#moderation-models). - example: safety_model_name + description: The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models). + example: 'safety_model_name' anyOf: - type: string enum: @@ -11158,33 +18150,19 @@ components: - type: string min_p: type: number - description: >- - A number between 0 and 1 that can be used as an alternative to top-p - and top-k. - format: float + description: A number between 0 and 1 that can be used as an alternative to top-p and top-k. presence_penalty: type: number - description: >- - A number between -2.0 and 2.0 where a positive value increases the - likelihood of a model talking about new topics. - format: float + description: A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics. frequency_penalty: type: number - description: >- - A number between -2.0 and 2.0 where a positive value decreases the - likelihood of repeating tokens that have already been mentioned. - format: float + description: A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned. logit_bias: type: object additionalProperties: type: number - format: float - description: >- - Adjusts the likelihood of specific tokens appearing in the generated - output. - example: - '105': 21.4 - '1024': -10.5 + description: Adjusts the likelihood of specific tokens appearing in the generated output. + example: {'1024': -10.5, '105': 21.4} seed: type: integer description: Seed value for reproducibility. @@ -11197,10 +18175,7 @@ components: choices: $ref: '#/components/schemas/CompletionChoicesData' prompt: - description: >- - When `echo` is true, the prompt is included in the response. - Additionally, when `logprobs` is also provided, log probability - information is provided on the prompt. + description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt. $ref: '#/components/schemas/PromptPart' usage: $ref: '#/components/schemas/UsageData' @@ -11219,25 +18194,22 @@ components: - prompt - model - object + CompletionStream: oneOf: - $ref: '#/components/schemas/CompletionEvent' - $ref: '#/components/schemas/StreamSentinel' + CompletionEvent: type: object - required: - - data + required: [data] properties: data: $ref: '#/components/schemas/CompletionChunk' + CompletionChunk: type: object - required: - - id - - token - - choices - - usage - - finish_reason + required: [id, token, choices, usage, finish_reason] properties: id: type: string @@ -11263,10 +18235,10 @@ components: allOf: - $ref: '#/components/schemas/FinishReason' - nullable: true + CompletionChoice: type: object - required: - - index + required: [index] properties: text: type: string @@ -11275,19 +18247,13 @@ components: delta: title: CompletionChoiceDelta type: object - required: - - role + required: [role] properties: token_id: type: integer role: type: string - enum: - - system - - user - - assistant - - function - - tool + enum: ['system', 'user', 'assistant', 'function', 'tool'] content: type: string nullable: true @@ -11310,13 +18276,10 @@ components: required: - arguments - name + CompletionToken: type: object - required: - - id - - text - - logprob - - special + required: [id, text, logprob, special] properties: id: type: integer @@ -11326,6 +18289,7 @@ components: type: number special: type: boolean + ChatCompletionChoicesData: type: array items: @@ -11349,17 +18313,14 @@ components: $ref: '#/components/schemas/TopLogprobs' ChatCompletionMessage: type: object - required: - - role - - content + required: [role, content] properties: content: type: string nullable: true role: type: string - enum: - - assistant + enum: [assistant] tool_calls: type: array items: @@ -11367,9 +18328,7 @@ components: function_call: type: object deprecated: true - required: - - arguments - - name + required: [arguments, name] properties: arguments: type: string @@ -11380,18 +18339,14 @@ components: nullable: true ChatCompletionTool: type: object - required: - - type - - function + required: [type, function] properties: type: type: string - enum: - - function + enum: ['function'] function: type: object - required: - - name + required: [name] properties: description: type: string @@ -11400,6 +18355,7 @@ components: parameters: type: object additionalProperties: true + ChatCompletionRequest: type: object required: @@ -11414,120 +18370,63 @@ components: model: type: string description: > - The name of the model to query.

[See all of Together AI's - chat - models](https://docs.together.ai/docs/serverless-models#chat-models) + The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models) max_tokens: type: integer description: The maximum number of tokens to generate. stop: type: array - description: >- - A list of string sequences that truncate (stop) inference text - output. For example, "" stops generation as soon as the model - generates the given token. + description: A list of string sequences that truncate (stop) inference text output. For example, "" stops generation as soon as the model generates the given token. items: type: string temperature: type: number - description: >- - A decimal number from 0-1 that determines the degree of randomness - in the response. A temperature less than 1 favors more correctness - and is appropriate for question answering or summarization. A value - closer to 1 introduces more randomness in the output. - format: float + description: A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output. top_p: type: number - description: >- - A percentage (also called the nucleus parameter) that's used to - dynamically adjust the number of choices for each predicted token - based on the cumulative probabilities. It specifies a probability - threshold below which all less likely tokens are filtered out. This - technique helps maintain diversity and generate more fluent and - natural-sounding text. - format: float + description: A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text. top_k: type: integer - description: >- - An integer that's used to limit the number of choices for the next - predicted word or token. It specifies the maximum number of tokens - to consider at each step, based on their probability of occurrence. - This technique helps to speed up the generation process and can - improve the quality of the generated text by focusing on the most - likely options. - format: int32 + description: An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options. context_length_exceeded_behavior: type: string - enum: - - truncate - - error - default: error - description: >- - Defines the behavior of the API when max_tokens exceed the maximum - context length of the model. When set to 'error', the API returns - 400 with an appropriate error message. When set to 'truncate', - overrides max_tokens with the maximum context length of the model. + enum: ['truncate', 'error'] + default: 'error' + description: Defines the behavior of the API when max_tokens exceed the maximum context length of the model. When set to 'error', the API returns 400 with an appropriate error message. When set to 'truncate', overrides max_tokens with the maximum context length of the model. repetition_penalty: type: number - description: >- - A number that controls the diversity of generated text by reducing - the likelihood of repeated sequences. Higher values decrease - repetition. + description: A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition. stream: type: boolean - description: >- - If true, stream tokens as Server-Sent Events as the model generates - them instead of waiting for the full model response. The stream - terminates with `data: [DONE]`. If false, return a single JSON - object containing the results. + description: 'If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with `data: [DONE]`. If false, return a single JSON object containing the results.' logprobs: type: integer minimum: 0 maximum: 20 - description: >- - An integer between 0 and 20 of the top k tokens to return log - probabilities for at each generation step, instead of only the - sampled token. Log probabilities help assess model confidence in - token predictions. + description: An integer between 0 and 20 of the top k tokens to return log probabilities for at each generation step, instead of only the sampled token. Log probabilities help assess model confidence in token predictions. echo: type: boolean - description: >- - If true, the response contains the prompt. Can be used with - `logprobs` to return prompt logprobs. - 'n': + description: If true, the response contains the prompt. Can be used with `logprobs` to return prompt logprobs. + n: type: integer description: The number of completions to generate for each prompt. minimum: 1 maximum: 128 min_p: type: number - description: >- - A number between 0 and 1 that can be used as an alternative to top_p - and top-k. - format: float + description: A number between 0 and 1 that can be used as an alternative to top_p and top-k. presence_penalty: type: number - description: >- - A number between -2.0 and 2.0 where a positive value increases the - likelihood of a model talking about new topics. - format: float + description: A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics. frequency_penalty: type: number - description: >- - A number between -2.0 and 2.0 where a positive value decreases the - likelihood of repeating tokens that have already been mentioned. - format: float + description: A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned. logit_bias: type: object additionalProperties: type: number - format: float - description: >- - Adjusts the likelihood of specific tokens appearing in the generated - output. - example: - '105': 21.4 - '1024': -10.5 + description: Adjusts the likelihood of specific tokens appearing in the generated output. + example: {'1024': -10.5, '105': 21.4} seed: type: integer description: Seed value for reproducibility. @@ -11535,36 +18434,23 @@ components: function_call: oneOf: - type: string - enum: - - none - - auto + enum: [none, auto] - type: object - required: - - name + required: [name] properties: name: type: string response_format: - description: > + description: | An object specifying the format that the model must output. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables - - Structured Outputs which ensures the model will match your supplied - JSON - + Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs - guide](https://docs.together.ai/docs/json-mode). - - Setting to `{ "type": "json_object" }` enables the older JSON mode, - which - - ensures the message the model generates is valid JSON. Using - `json_schema` - + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it. discriminator: propertyName: type @@ -11574,20 +18460,14 @@ components: - $ref: '#/components/schemas/ResponseFormatJsonObject' tools: type: array - description: >- - A list of tools the model may call. Currently, only functions are - supported as a tool. Use this to provide a list of functions the - model may generate JSON inputs for. + description: A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. items: $ref: '#/components/schemas/ToolsPart' tool_choice: - description: >- - Controls which (if any) function is called by the model. By default - uses `auto`, which lets the model pick between generating a message - or calling a function. + description: Controls which (if any) function is called by the model. By default uses `auto`, which lets the model pick between generating a message or calling a function. oneOf: - type: string - example: tool_name + example: 'tool_name' - $ref: '#/components/schemas/ToolChoice' compliance: const: hipaa @@ -11597,30 +18477,20 @@ components: additional_properties: true safety_model: type: string - description: >- - The name of the moderation model used to validate tokens. Choose - from the available moderation models found - [here](https://docs.together.ai/docs/inference-models#moderation-models). - example: safety_model_name + description: The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models). + example: 'safety_model_name' reasoning_effort: type: string - enum: - - low - - medium - - high - description: >- - Controls the level of reasoning effort the model should apply when - generating responses. Higher values may result in more thoughtful - and detailed responses but may take longer to generate. - example: medium + enum: ['low', 'medium', 'high'] + description: Controls the level of reasoning effort the model should apply when generating responses. Higher values may result in more thoughtful and detailed responses but may take longer to generate. + example: 'medium' reasoning: - description: >- - For models that support toggling reasoning functionality, this - object can be used to control that functionality. + description: For models that support toggling reasoning functionality, this object can be used to control that functionality. type: object properties: enabled: type: boolean + ResponseFormatText: type: object title: Text @@ -11638,16 +18508,10 @@ components: ResponseFormatJsonObject: type: object title: JSON object - description: > - JSON object response format. An older method of generating JSON - responses. - - Using `json_schema` is recommended for models that support it. Note that - the - - model will not generate JSON without a system or user message - instructing it - + description: | + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it to do so. properties: type: @@ -11661,11 +18525,9 @@ components: ResponseFormatJsonSchema: type: object title: JSON schema - description: > + description: | JSON Schema response format. Used to generate structured JSON responses. - - Learn more about [Structured - Outputs](https://docs.together.ai/docs/json-mode). + Learn more about [Structured Outputs](https://docs.together.ai/docs/json-mode). properties: type: type: string @@ -11681,17 +18543,13 @@ components: properties: description: type: string - description: > - A description of what the response format is for, used by the - model to - + description: | + A description of what the response format is for, used by the model to determine how to respond in the format. name: type: string - description: > - The name of the response format. Must be a-z, A-Z, 0-9, or - contain - + description: | + The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. schema: $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' @@ -11699,19 +18557,11 @@ components: anyOf: - type: boolean default: false - description: > - Whether to enable strict schema adherence when generating - the output. - - If set to true, the model will always follow the exact - schema defined - - in the `schema` field. Only a subset of JSON Schema is - supported when - - `strict` is `true`. To learn more, read the [Structured - Outputs - + description: | + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs guide](https://docs.together.ai/docs/json-mode). - type: 'null' required: @@ -11726,6 +18576,7 @@ components: The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/). additionalProperties: true + ChatCompletionMessageParam: oneOf: - $ref: '#/components/schemas/ChatCompletionSystemMessageParam' @@ -11733,37 +18584,37 @@ components: - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam' - $ref: '#/components/schemas/ChatCompletionToolMessageParam' - $ref: '#/components/schemas/ChatCompletionFunctionMessageParam' + + # Start Message Params + ChatCompletionSystemMessageParam: type: object - required: - - content - - role + required: [content, role] properties: content: type: string role: type: string - enum: - - system + enum: ['system'] name: type: string + ChatCompletionUserMessageParam: type: object - required: - - content - - role + required: [content, role] properties: content: $ref: '#/components/schemas/ChatCompletionUserMessageContent' role: type: string - enum: - - user + enum: ['user'] name: type: string + ChatCompletionUserMessageContentString: type: string description: A plain text message. + ChatCompletionUserMessageContentMultimodal: type: array description: A structured message with mixed content types. @@ -11855,25 +18706,23 @@ components: required: - type - input_audio + ChatCompletionUserMessageContent: - description: >- - The content of the message, which can either be a simple string or a - structured format. + description: The content of the message, which can either be a simple string or a structured format. oneOf: - $ref: '#/components/schemas/ChatCompletionUserMessageContentString' - $ref: '#/components/schemas/ChatCompletionUserMessageContentMultimodal' + ChatCompletionAssistantMessageParam: type: object - required: - - role + required: [role] properties: content: type: string nullable: true role: type: string - enum: - - assistant + enum: ['assistant'] name: type: string tool_calls: @@ -11888,25 +18737,21 @@ components: type: string name: type: string - required: - - arguments - - name + required: [arguments, name] + ChatCompletionFunctionMessageParam: type: object deprecated: true - required: - - content - - role - - name + required: [content, role, name] properties: role: type: string - enum: - - function + enum: ['function'] content: type: string name: type: string + ChatCompletionToolMessageParam: type: object properties: @@ -11914,16 +18759,15 @@ components: type: string role: type: string - enum: - - tool + enum: ['tool'] content: type: string tool_call_id: type: string - required: - - role - - content - - tool_call_id + required: [role, content, tool_call_id] + + # End Message Params + ChatCompletionResponse: type: object properties: @@ -11938,10 +18782,7 @@ components: model: type: string prompt: - description: >- - When `echo` is true, the prompt is included in the response. - Additionally, when `logprobs` is also provided, log probability - information is provided on the prompt. + description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt. $ref: '#/components/schemas/PromptPart' object: description: The object type, which is always `chat.completion`. @@ -11950,32 +18791,23 @@ components: type: array items: $ref: '#/components/schemas/InferenceWarning' - required: - - choices - - id - - created - - model - - object - - prompt + required: [choices, id, created, model, object, prompt] + ChatCompletionStream: oneOf: - $ref: '#/components/schemas/ChatCompletionEvent' - $ref: '#/components/schemas/StreamSentinel' + ChatCompletionEvent: type: object - required: - - data + required: [data] properties: data: $ref: '#/components/schemas/ChatCompletionChunk' + ChatCompletionChunk: type: object - required: - - id - - object - - created - - choices - - model + required: [id, object, created, choices, model] properties: id: type: string @@ -11994,10 +18826,7 @@ components: type: array items: type: object - required: - - index - - delta - - finish_reason + required: [index, delta, finish_reason] properties: index: type: integer @@ -12015,19 +18844,13 @@ components: delta: title: ChatCompletionChoiceDelta type: object - required: - - role + required: [role] properties: token_id: type: integer role: type: string - enum: - - system - - user - - assistant - - function - - tool + enum: ['system', 'user', 'assistant', 'function', 'tool'] content: type: string nullable: true @@ -12067,11 +18890,7 @@ components: properties: model: description: > - The name of the model to query.

[See all of Together AI's - chat - models](https://docs.together.ai/docs/serverless-models#audio-models) - The current supported tts models are: - cartesia/sonic - - hexgrad/Kokoro-82M - canopylabs/orpheus-3b-0.1-ft + The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models) The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M - canopylabs/orpheus-3b-0.1-ft example: canopylabs/orpheus-3b-0.1-ft anyOf: - type: string @@ -12085,28 +18904,11 @@ components: description: Input text to generate the audio for voice: description: > - The voice to use for generating the audio. The voices supported are - different for each model. For eg - for canopylabs/orpheus-3b-0.1-ft, - one of the voices supported is tara, for hexgrad/Kokoro-82M, one of - the voices supported is af_alloy and for cartesia/sonic, one of the - voices supported is "friendly sidekick".

You can view the - voices supported for each model using the /v1/voices endpoint - sending the model name as the query parameter. [View all supported - voices - here](https://docs.together.ai/docs/text-to-speech#supported-voices). -

`hexgrad/Kokoro-82M` additionally supports voice mixing, - where two or more voices are combined into a single blended voice by - joining their names with `+` (e.g. `af_bella+af_heart`). Optional - per-voice weights can be provided in parentheses (e.g. - `af_bella(2)+af_heart(1)`). Other models require a single voice - name. + The voice to use for generating the audio. The voices supported are different for each model. For eg - for canopylabs/orpheus-3b-0.1-ft, one of the voices supported is tara, for hexgrad/Kokoro-82M, one of the voices supported is af_alloy and for cartesia/sonic, one of the voices supported is "friendly sidekick".

You can view the voices supported for each model using the /v1/voices endpoint sending the model name as the query parameter. [View all supported voices here](https://docs.together.ai/docs/text-to-speech#supported-voices).

`hexgrad/Kokoro-82M` additionally supports voice mixing, where two or more voices are combined into a single blended voice by joining their names with `+` (e.g. `af_bella+af_heart`). Optional per-voice weights can be provided in parentheses (e.g. `af_bella(2)+af_heart(1)`). Other models require a single voice name. type: string response_format: type: string - description: >- - The format of audio output. Supported formats are mp3, wav, raw if - streaming is false. If streaming is true, the only supported format - is raw. + description: The format of audio output. Supported formats are mp3, wav, raw if streaming is false. If streaming is true, the only supported format is raw. default: wav enum: - mp3 @@ -12114,20 +18916,13 @@ components: - raw language: type: string - description: > - Language or locale of input text. Accepts ISO 639-1 language codes - (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for - region-specific variants. Locale codes must be lowercase (e.g., - `zh-hk` for Cantonese). + description: | + Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale codes must be lowercase (e.g., `zh-hk` for Cantonese). default: en example: en response_encoding: type: string - description: >- - Audio encoding of response. Only applicable when response_format is - raw or pcm. Cartesia models respect this parameter and support all - values. Orpheus, Kokoro, and Minimax models always return pcm_s16le - regardless of this setting. + description: Audio encoding of response. Only applicable when response_format is raw or pcm. Cartesia models respect this parameter and support all values. Orpheus, Kokoro, and Minimax models always return pcm_s16le regardless of this setting. default: pcm_f32le enum: - pcm_f32le @@ -12137,17 +18932,10 @@ components: sample_rate: type: integer default: 44100 - description: >- - Sampling rate in Hz for the output audio. Cartesia and Minimax - models respect this parameter. Orpheus and Kokoro models always - output at 24000 Hz regardless of this setting. + description: Sampling rate in Hz for the output audio. Cartesia and Minimax models respect this parameter. Orpheus and Kokoro models always output at 24000 Hz regardless of this setting. bit_rate: type: integer - description: >- - Bitrate of the MP3 audio output in bits per second. Only applicable - when response_format is mp3. Higher values produce better audio - quality at larger file sizes. Default is 128000. Currently supported - on Cartesia models. + description: Bitrate of the MP3 audio output in bits per second. Only applicable when response_format is mp3. Higher values produce better audio quality at larger file sizes. Default is 128000. Currently supported on Cartesia models. default: 128000 enum: - 32000 @@ -12158,27 +18946,18 @@ components: stream: type: boolean default: false - description: >- - If true, output is streamed for several characters at a time instead - of waiting for the full response. The stream terminates with `data: - [DONE]`. If false, return the encoded audio as octet stream + description: 'If true, output is streamed for several characters at a time instead of waiting for the full response. The stream terminates with `data: [DONE]`. If false, return the encoded audio as octet stream' extra_params: type: object - description: >- - Additional model-specific parameters that fine-tune speech - generation behavior. + description: Additional model-specific parameters that fine-tune speech generation behavior. properties: pronunciation_dict: type: array items: type: string - description: >- - A list of pronunciation rules for specific characters or - symbols. Each entry uses the format `"/"` - (e.g., `["omg/oh my god"]`) to override how the model pronounces - matching tokens. - example: - - omg/oh my god + description: A list of pronunciation rules for specific characters or symbols. Each entry uses the format `"/"` (e.g., `["omg/oh my god"]`) to override how the model pronounces matching tokens. + example: ["omg/oh my god"] + AudioTranscriptionRequest: type: object required: @@ -12189,8 +18968,7 @@ components: - $ref: '#/components/schemas/AudioFileBinary' - $ref: '#/components/schemas/AudioFileUrl' description: >- - Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, - .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. model: type: string description: Model to use for transcription @@ -12199,18 +18977,13 @@ components: - openai/whisper-large-v3 language: type: string - description: >- - Optional ISO 639-1 language code. If `auto` is provided, language is - auto-detected. + description: Optional ISO 639-1 language code. If `auto` is provided, language is auto-detected. default: en example: en prompt: type: string description: >- - Optional text to bias decoding. Supported only on Whisper-family - models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. - `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API - compatibility but ignore it. + Optional text to bias decoding. Supported only on Whisper-family models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore it. response_format: type: string description: The format of the response @@ -12220,11 +18993,10 @@ components: - verbose_json temperature: type: number - format: float description: Sampling temperature between 0.0 and 1.0 - default: 0 - minimum: 0 - maximum: 1 + default: 0.0 + minimum: 0.0 + maximum: 1.0 timestamp_granularities: oneOf: - type: string @@ -12240,24 +19012,13 @@ components: uniqueItems: true minItems: 1 maxItems: 2 - description: >- - Controls level of timestamp detail in verbose_json. Only used when - response_format is verbose_json. Can be a single granularity or an - array to get multiple levels. + description: Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels. default: segment - example: - - word - - segment + example: ['word', 'segment'] diarize: type: boolean description: > - Whether to enable speaker diarization. When enabled, you will get - the speaker id for each word in the transcription. In the response, - in the words array, you will get the speaker id for each word. In - addition, we also return the speaker_segments array which contains - the speaker id for each speaker segment along with the start and end - time of the segment along with all the words in the segment.
-
For eg - ... "speaker_segments": [ + Whether to enable speaker diarization. When enabled, you will get the speaker id for each word in the transcription. In the response, in the words array, you will get the speaker id for each word. In addition, we also return the speaker_segments array which contains the speaker id for each speaker segment along with the start and end time of the segment along with all the words in the segment.

For eg - ... "speaker_segments": [ "speaker_id": "SPEAKER_00", "start": 0, "end": 30.02, @@ -12273,20 +19034,16 @@ components: default: false min_speakers: type: integer - description: >- - Minimum number of speakers expected in the audio. Used to improve - diarization accuracy when the approximate number of speakers is - known. + description: Minimum number of speakers expected in the audio. Used to improve diarization accuracy when the approximate number of speakers is known. max_speakers: type: integer - description: >- - Maximum number of speakers expected in the audio. Used to improve - diarization accuracy when the approximate number of speakers is - known. + description: Maximum number of speakers expected in the audio. Used to improve diarization accuracy when the approximate number of speakers is known. + AudioTranscriptionResponse: oneOf: - $ref: '#/components/schemas/AudioTranscriptionJsonResponse' - $ref: '#/components/schemas/AudioTranscriptionVerboseJsonResponse' + AudioTranscriptionJsonResponse: type: object required: @@ -12296,6 +19053,7 @@ components: type: string description: The transcribed text example: Hello, world! + AudioTranscriptionVerboseJsonResponse: type: object required: @@ -12310,7 +19068,6 @@ components: example: english duration: type: number - format: float description: The duration of the audio in seconds example: 3.5 text: @@ -12326,16 +19083,13 @@ components: type: array items: $ref: '#/components/schemas/AudioTranscriptionWord' - description: >- - Array of transcription words (only when timestamp_granularities - includes 'word') + description: Array of transcription words (only when timestamp_granularities includes 'word') speaker_segments: type: array items: $ref: '#/components/schemas/AudioTranscriptionSpeakerSegment' - description: >- - Array of transcription speaker segments (only when diarize is - enabled) + description: Array of transcription speaker segments (only when diarize is enabled) + AudioTranscriptionSegment: type: object required: @@ -12350,18 +19104,17 @@ components: example: 0 start: type: number - format: float description: Start time of the segment in seconds - example: 0 + example: 0.0 end: type: number - format: float description: End time of the segment in seconds example: 3.5 text: type: string description: The text content of the segment example: Hello, world! + AudioTranscriptionWord: type: object required: @@ -12375,18 +19128,17 @@ components: example: Hello start: type: number - format: float description: Start time of the word in seconds - example: 0 + example: 0.0 end: type: number - format: float description: End time of the word in seconds example: 0.5 speaker_id: type: string description: The speaker id for the word (only when diarize is enabled) example: SPEAKER_00 + AudioTranscriptionSpeakerSegment: type: object required: @@ -12403,12 +19155,10 @@ components: example: SPEAKER_00 start: type: number - format: float description: Start time of the speaker segment in seconds - example: 0 + example: 0.0 end: type: number - format: float description: End time of the speaker segment in seconds example: 30.02 words: @@ -12419,11 +19169,12 @@ components: text: type: string description: The full text spoken by this speaker in this segment - example: Hello, how are you doing today? + example: "Hello, how are you doing today?" id: type: integer description: Unique identifier for the speaker segment example: 1 + AudioTranslationRequest: type: object required: @@ -12433,13 +19184,14 @@ components: oneOf: - type: string format: binary - description: Audio file to translate + description: >- + Audio file uploaded as binary. Maximum upload size 500 MB (requests above this are rejected at the edge with HTTP 413). For larger payloads, host the file and submit a URL instead. - type: string format: uri - description: Public HTTP/HTTPS URL to audio file + description: >- + Public HTTPS URL the server fetches the audio from. Server-side fetch limit is 1 GB; downloads exceeding the cap fail with `file_too_large`. description: >- - Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, - .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. + Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB. model: type: string description: Model to use for translation @@ -12448,18 +19200,13 @@ components: - openai/whisper-large-v3 language: type: string - description: >- - Target output language. Optional ISO 639-1 language code. If - omitted, language is set to English. + description: Target output language. Optional ISO 639-1 language code. If omitted, language is set to English. default: en example: en prompt: type: string description: >- - Optional text to bias decoding. Supported only on Whisper-family - models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. - `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API - compatibility but ignore it. + Optional text to bias decoding. Supported only on Whisper-family models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore it. response_format: type: string description: The format of the response @@ -12469,11 +19216,10 @@ components: - verbose_json temperature: type: number - format: float description: Sampling temperature between 0.0 and 1.0 - default: 0 - minimum: 0 - maximum: 1 + default: 0.0 + minimum: 0.0 + maximum: 1.0 timestamp_granularities: oneOf: - type: string @@ -12489,18 +19235,15 @@ components: uniqueItems: true minItems: 1 maxItems: 2 - description: >- - Controls level of timestamp detail in verbose_json. Only used when - response_format is verbose_json. Can be a single granularity or an - array to get multiple levels. + description: Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels. default: segment - example: - - word - - segment + example: ['word', 'segment'] + AudioTranslationResponse: oneOf: - $ref: '#/components/schemas/AudioTranslationJsonResponse' - $ref: '#/components/schemas/AudioTranslationVerboseJsonResponse' + AudioTranslationJsonResponse: type: object required: @@ -12510,6 +19253,7 @@ components: type: string description: The translated text example: Hello, world! + AudioTranslationVerboseJsonResponse: type: object required: @@ -12524,7 +19268,6 @@ components: example: english duration: type: number - format: float description: The duration of the audio in seconds example: 3.5 text: @@ -12540,26 +19283,23 @@ components: type: array items: $ref: '#/components/schemas/AudioTranscriptionWord' - description: >- - Array of translation words (only when timestamp_granularities - includes 'word') + description: Array of translation words (only when timestamp_granularities includes 'word') + AudioSpeechStreamResponse: oneOf: - $ref: '#/components/schemas/AudioSpeechStreamEvent' - $ref: '#/components/schemas/StreamSentinel' + AudioSpeechStreamEvent: type: object - required: - - data + required: [data] properties: data: $ref: '#/components/schemas/AudioSpeechStreamChunk' + AudioSpeechStreamChunk: type: object - required: - - object - - model - - b64 + required: [object, model, b64] properties: object: description: The object type, which is always `audio.tts.chunk`. @@ -12570,23 +19310,20 @@ components: b64: type: string description: base64 encoded audio stream + StreamSentinel: type: object - required: - - data + required: [data] properties: data: title: stream_signal type: string enum: - '[DONE]' + ChatCompletionToken: type: object - required: - - id - - text - - logprob - - special + required: [id, text, logprob, special] properties: id: type: integer @@ -12596,12 +19333,10 @@ components: type: number special: type: boolean + ChatCompletionChoice: type: object - required: - - index - - delta - - finish_reason + required: [index, delta, finish_reason] properties: index: type: integer @@ -12612,19 +19347,13 @@ components: delta: title: ChatCompletionChoiceDelta type: object - required: - - role + required: [role] properties: token_id: type: integer role: type: string - enum: - - system - - user - - assistant - - function - - tool + enum: ['system', 'user', 'assistant', 'function', 'tool'] content: type: string nullable: true @@ -12647,6 +19376,7 @@ components: reasoning: type: string nullable: true + EmbeddingsRequest: type: object required: @@ -12656,9 +19386,7 @@ components: model: type: string description: > - The name of the embedding model to use.

[See all of - Together AI's embedding - models](https://docs.together.ai/docs/serverless-models#embedding-models) + The name of the embedding model to use.

[See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models) example: togethercomputer/m2-bert-80M-8k-retrieval anyOf: - type: string @@ -12672,17 +19400,14 @@ components: oneOf: - type: string description: A string providing the text for the model to embed. - example: >- - Our solar system orbits the Milky Way galaxy at about 515,000 - mph + example: Our solar system orbits the Milky Way galaxy at about 515,000 mph - type: array items: type: string description: A string providing the text for the model to embed. - example: >- - Our solar system orbits the Milky Way galaxy at about 515,000 - mph + example: Our solar system orbits the Milky Way galaxy at about 515,000 mph example: Our solar system orbits the Milky Way galaxy at about 515,000 mph + EmbeddingsResponse: type: object required: @@ -12699,10 +19424,7 @@ components: type: array items: type: object - required: - - index - - object - - embedding + required: [index, object, embedding] properties: object: description: The object type, which is always `embedding`. @@ -12713,21 +19435,18 @@ components: type: number index: type: integer + ModelInfoList: type: array items: $ref: '#/components/schemas/ModelInfo' ModelInfo: type: object - required: - - id - - object - - created - - type + required: [id, object, created, type] properties: id: type: string - example: Austism/chronos-hermes-13b + example: 'Austism/chronos-hermes-13b' object: description: The object type, which is always `model`. const: model @@ -12743,23 +19462,24 @@ components: - embedding - moderation - rerank - example: chat + example: 'chat' display_name: type: string - example: Chronos Hermes (13B) + example: 'Chronos Hermes (13B)' organization: type: string - example: Austism + example: 'Austism' link: type: string license: type: string - example: other + example: 'other' context_length: type: integer example: 2048 pricing: $ref: '#/components/schemas/Pricing' + ModelUploadRequest: type: object required: @@ -12769,39 +19489,36 @@ components: model_name: type: string description: The name to give to your uploaded model - example: Qwen2.5-72B-Instruct + example: 'Qwen2.5-72B-Instruct' model_source: type: string description: The source location of the model (Hugging Face repo or S3 path) - example: unsloth/Qwen2.5-72B-Instruct + example: 'unsloth/Qwen2.5-72B-Instruct' model_type: type: string description: Whether the model is a full model or an adapter - default: model + default: 'model' enum: - model - adapter - example: model + example: 'model' hf_token: type: string description: Hugging Face token (if uploading from Hugging Face) - example: hf_examplehuggingfacetoken + example: 'hf_examplehuggingfacetoken' description: type: string description: A description of your model - example: Finetuned Qwen2.5-72B-Instruct by Unsloth + example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth' base_model: type: string - description: >- - The base model to use for an adapter if setting it to run against a - serverless pool. Only used for model_type `adapter`. - example: Qwen/Qwen2.5-72B-Instruct + description: The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`. + example: 'Qwen/Qwen2.5-72B-Instruct' lora_model: type: string - description: >- - The lora pool to use for an adapter if setting it to run against, - say, a dedicated pool. Only used for model_type `adapter`. - example: my_username/Qwen2.5-72B-Instruct-lora + description: The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`. + example: 'my_username/Qwen2.5-72B-Instruct-lora' + ModelUploadSuccessResponse: type: object required: @@ -12818,19 +19535,20 @@ components: properties: job_id: type: string - example: job-a15dad11-8d8e-4007-97c5-a211304de284 + example: 'job-a15dad11-8d8e-4007-97c5-a211304de284' model_name: type: string - example: necolinehubner/Qwen2.5-72B-Instruct + example: 'necolinehubner/Qwen2.5-72B-Instruct' model_id: type: string - example: model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7 + example: 'model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7' model_source: type: string - example: huggingface + example: 'huggingface' message: type: string - example: Processing model weights. Job created. + example: 'Processing model weights. Job created.' + ImageResponse: type: object properties: @@ -12854,12 +19572,10 @@ components: - model - object - data + ImageResponseDataB64: type: object - required: - - index - - b64_json - - type + required: [index, b64_json, type] properties: index: type: integer @@ -12867,14 +19583,11 @@ components: type: string type: type: string - enum: - - b64_json + enum: [b64_json] + ImageResponseDataUrl: type: object - required: - - index - - url - - type + required: [index, url, type] properties: index: type: integer @@ -12882,8 +19595,8 @@ components: type: string type: type: string - enum: - - url + enum: [url] + JobInfoSuccessResponse: type: object required: @@ -12897,18 +19610,14 @@ components: properties: type: type: string - example: model_upload + example: 'model_upload' job_id: type: string - example: job-a15dad11-8d8e-4007-97c5-a211304de284 + example: 'job-a15dad11-8d8e-4007-97c5-a211304de284' status: type: string - enum: - - Queued - - Running - - Complete - - Failed - example: Complete + enum: ['Queued', 'Running', 'Complete', 'Failed'] + example: 'Complete' status_updates: type: array items: @@ -12920,10 +19629,10 @@ components: properties: status: type: string - example: Complete + example: 'Complete' message: type: string - example: Job is Complete + example: 'Job is Complete' timestamp: type: string format: date-time @@ -12933,13 +19642,13 @@ components: properties: description: type: string - example: Finetuned Qwen2.5-72B-Instruct by Unsloth + example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth' modelName: type: string - example: necolinehubner/Qwen2.5-72B-Instruct + example: 'necolinehubner/Qwen2.5-72B-Instruct' modelSource: type: string - example: unsloth/Qwen2.5-72B-Instruct + example: 'unsloth/Qwen2.5-72B-Instruct' created_at: type: string format: date-time @@ -12948,6 +19657,7 @@ components: type: string format: date-time example: '2025-03-11T22:36:12Z' + JobsInfoSuccessResponse: type: object required: @@ -12957,14 +19667,10 @@ components: type: array items: $ref: '#/components/schemas/JobInfoSuccessResponse' + Pricing: type: object - required: - - hourly - - input - - output - - base - - finetune + required: [hourly, input, output, base, finetune] properties: base: type: number @@ -12984,52 +19690,48 @@ components: cached_input: type: number example: 0.2 + ToolsPart: type: object properties: type: type: string - example: tool_type + example: 'tool_type' function: type: object properties: description: type: string - example: A description of the function. + example: 'A description of the function.' name: type: string - example: function_name + example: 'function_name' parameters: type: object additionalProperties: true - description: A map of parameter names to their values. + description: 'A map of parameter names to their values.' ToolChoice: type: object - required: - - id - - type - - function - - index + required: [id, type, function, index] properties: + # TODO: is this the right place for index? index: type: number id: type: string type: type: string - enum: - - function + enum: ['function'] function: type: object - required: - - name - - arguments + required: [name, arguments] properties: name: type: string - example: function_name + example: 'function_name' arguments: type: string + FileResponse: description: Structured information describing a file uploaded to Together. type: object @@ -13055,7 +19757,7 @@ components: filename: description: The name of the file as it was uploaded. type: string - example: my_file.jsonl + example: 'my_file.jsonl' bytes: description: The number of bytes in the file. type: integer @@ -13063,13 +19765,88 @@ components: description: The purpose of the file as it was uploaded. $ref: '#/components/schemas/FilePurpose' Processed: - description: >- - Whether the file has been parsed and analyzed for correctness for - fine-tuning. + description: | + Deprecated. Whether file has been fully uploaded. type: boolean + deprecated: true FileType: description: The type of the file such as `jsonl`, `csv`, or `parquet`. $ref: '#/components/schemas/FileType' + processing_status: + description: | + Lifecycle state of the file validation pipeline. Files for + non-`fine-tune` purposes skip validation. + $ref: '#/components/schemas/FileProcessingStatus' + validation_report: + description: | + Report produced by the file validation pipeline. Present once + validation has run; absent on files that bypassed validation + (non-`fine-tune` purposes) or have not yet been validated. + $ref: '#/components/schemas/FileValidationReport' + FileProcessingStatus: + description: | + Lifecycle state of a file in the validation pipeline. The typical + progression is `PENDING` → `QUEUED` → `RUNNING` → `COMPLETED` / + `FAILED`. `INVALID_FORMAT` is a terminal state for files whose + contents failed validation in a user-correctable way. + type: string + enum: + - PENDING + - QUEUED + - RUNNING + - COMPLETED + - FAILED + - INVALID_FORMAT + FileValidationReport: + description: | + Validation outcome for a fine-tune training file, produced by the + file validation pipeline. + type: object + required: + - valid + properties: + valid: + description: Whether the file passed validation. + type: boolean + dataset_format: + description: Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`). + type: string + dataset_has_sample_weights: + description: Whether the dataset carries per-sample weights. + type: boolean + dataset_has_message_weights: + description: Whether the dataset carries per-message weights (only possible for `CONVERSATION` format). + type: boolean + dataset_is_multimodal: + description: Whether the dataset contains multimodal content. + type: boolean + dataset_has_tools: + description: Whether the dataset contains tool-use messages. + type: boolean + dataset_has_parallel_tool_calls: + description: Whether the dataset contains parallel tool-use messages. + type: boolean + dataset_has_reasoning: + description: Whether the dataset contains reasoning content. + type: boolean + nlines: + description: Number of lines (records) in the dataset. + type: integer + + file_id: + description: ID of the file this report describes. + type: string + error_type: + description: | + Category of validation failure. + type: string + enum: + - INVALID_FORMAT + error: + description: | + Human-readable validation error message. Only present when + `error_type` is set (i.e. user-correctable failures). + type: string FileList: required: - data @@ -13082,7 +19859,7 @@ components: FilePurpose: type: string description: The purpose of the file - example: fine-tune + example: 'fine-tune' enum: - fine-tune - eval @@ -13090,12 +19867,12 @@ components: FileType: type: string description: The type of the file - default: jsonl - example: jsonl + default: 'jsonl' + example: 'jsonl' enum: - - csv - - jsonl - - parquet + - 'csv' + - 'jsonl' + - 'parquet' FileDeleteResponse: type: object properties: @@ -13108,6 +19885,7 @@ components: required: - id - status + - user_id properties: id: type: string @@ -13122,6 +19900,27 @@ components: type: string model_output_path: type: string + model_object_id: + type: string + description: Together model registry object ID for the final model weights (e.g. `ml_...`). + model_object_name: + type: string + description: Together model registry name for the final model weights, formatted as `/`. + model_object_revision_id: + type: string + description: Together model registry revision ID for the final model weights (e.g. `rv_...`). + adapter_object_id: + type: string + description: Together model registry object ID for the final adapter weights on LoRA jobs. + adapter_object_name: + type: string + description: Together model registry name for the final adapter weights on LoRA jobs, formatted as `/-adapter`. + adapter_object_revision_id: + type: string + description: Together model registry revision ID for the final adapter weights on LoRA jobs. + user_id: + type: string + description: ID of the user who created the fine-tune job. trainingfile_numlines: type: integer trainingfile_size: @@ -13147,7 +19946,7 @@ components: - type: string enum: - max - default: max + default: 'max' learning_rate: type: number lr_scheduler: @@ -13157,10 +19956,8 @@ components: type: number max_grad_norm: type: number - format: float weight_decay: type: number - format: float eval_steps: type: integer train_on_inputs: @@ -13212,31 +20009,42 @@ components: type: string progress: $ref: '#/components/schemas/FineTuneProgress' + early_stopped: + type: boolean + description: Whether the early-stopping criterion triggered. + early_stopping_best_step: + type: integer + description: > + Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + early_stopping_best_metric: + type: number + nullable: true + description: Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded (for example, a non-finite first evaluation). + FinetuneResponseTruncated: type: object - description: >- - A truncated version of the fine-tune response, used for POST - /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints + description: A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints required: - id - status - created_at - updated_at + - user_id example: id: ft-01234567890123456789 status: completed created_at: '2023-05-17T17:35:45.123Z' updated_at: '2023-05-17T18:46:23.456Z' - user_id: user_01234567890123456789 - owner_address: user@example.com + user_id: user_789xyz012 + owner_address: 'user@example.com' total_price: 1500 token_count: 850000 - events: [] - model: meta-llama/Llama-2-7b-hf - model_output_name: mynamespace/meta-llama/Llama-2-7b-hf-32162631 + events: [] # FineTuneTruncated object has no events + model: 'meta-llama/Llama-2-7b-hf' + model_output_name: 'mynamespace/meta-llama/Llama-2-7b-hf-32162631' n_epochs: 3 - training_file: file-01234567890123456789 - wandb_project_name: my-finetune-project + training_file: 'file-01234567890123456789' + wandb_project_name: 'my-finetune-project' properties: id: type: string @@ -13257,7 +20065,7 @@ components: description: Start timestamp of the current stage of the fine-tune job user_id: type: string - description: Identifier for who created the job. + description: ID of the user who created the fine-tune job. owner_address: type: string description: Owner address information @@ -13272,6 +20080,7 @@ components: items: $ref: '#/components/schemas/FineTuneEvent' description: Events related to this fine-tune job + # FineTuneUserParams fields training_file: type: string description: File-ID of the training file @@ -13283,9 +20092,7 @@ components: description: Whether sequence packing is being used for training. max_seq_length: type: integer - description: >- - Maximum sequence length to use for training. If not specified, uses - the maximum allowed for the model and training method. + description: Maximum sequence length to use for training. If not specified, uses the maximum allowed for the model and training method. model: type: string description: Base model used for fine-tuning @@ -13318,29 +20125,24 @@ components: description: Method of training used learning_rate: type: number - format: float description: Learning rate used for training lr_scheduler: $ref: '#/components/schemas/LRScheduler' description: Learning rate scheduler configuration warmup_ratio: type: number - format: float description: Ratio of warmup steps max_grad_norm: type: number - format: float description: Maximum gradient norm for clipping weight_decay: type: number - format: float description: Weight decay value used random_seed: type: integer nullable: true description: > - Random seed used for training. Integer when set; null if not stored - (e.g. legacy jobs) or no explicit seed was recorded. + Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded. wandb_project_name: type: string description: Weights & Biases project name @@ -13359,25 +20161,167 @@ components: progress: $ref: '#/components/schemas/FineTuneProgress' description: Progress information for the fine-tuning job + early_stopped: + type: boolean + description: Whether the early-stopping criterion triggered. + early_stopping_best_step: + type: integer + description: > + Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step. + early_stopping_best_metric: + type: number + nullable: true + description: Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded. FinetuneDeleteResponse: type: object properties: message: type: string description: Message indicating the result of the deletion + FineTunePreviewRequest: + type: object + description: Request body for previewing tokenized fine-tuning data. + required: + - model + - training_file + properties: + model: + type: string + description: Name of the base model whose tokenizer and chat template will be used. + training_file: + type: string + description: File-ID of the uploaded JSONL training file to sample for preview. + training_method: + type: string + default: sft + enum: ['sft'] + description: Fine-tuning method to preview. Only supervised fine-tuning is currently supported. + train_on_inputs: + type: boolean + default: false + description: Whether prompt or user-message tokens should contribute to training loss in the preview. + top_k: + type: integer + default: 5 + minimum: 1 + maximum: 50 + description: Maximum number of rows from the start of the training file to tokenize. + FineTunePreviewResponse: + type: object + description: Tokenized preview for sampled rows from a fine-tuning training file. + required: + - model + - dataset_format + - max_seq_length + - train_on_inputs + - rows + properties: + model: + type: string + description: Name of the base model used to tokenize the sampled rows. + dataset_format: + type: string + enum: ['general', 'conversation', 'instruction'] + description: Detected SFT dataset format for the sampled rows. + max_seq_length: + type: integer + description: Maximum sequence length configured for the requested model. + train_on_inputs: + type: boolean + description: Whether prompt or user-message tokens contribute to training loss. + rows: + type: array + description: Tokenized preview rows, in the same order as the sampled training file rows. + items: + $ref: '#/components/schemas/FineTunePreviewRow' + FineTunePreviewRow: + type: object + description: Tokenized representation of one sampled fine-tuning row. + required: + - input_ids + - tokens + - labels + - trained_spans + - num_tokens + - num_trained_tokens + - truncated + properties: + input_ids: + type: array + description: Token IDs produced for the sampled row. + items: + type: integer + description: Token ID from the model tokenizer. + tokens: + type: array + description: Raw token strings produced for the sampled row. + items: + type: string + description: Token text from the model tokenizer. + labels: + type: array + description: Training labels for each token; masked tokens use -100. + items: + type: integer + description: Label value for the token at the same position. + trained_spans: + type: array + description: Half-open token index ranges that contribute to training loss. + items: + type: array + minItems: 2 + maxItems: 2 + description: Start and end token indexes for one trained span. + items: + type: integer + description: Token index in the row. + num_tokens: + type: integer + description: Total number of tokens in the preview row after truncation. + num_trained_tokens: + type: integer + description: Number of tokens in the row that contribute to training loss. + truncated: + type: boolean + description: Whether the row was truncated to the model maximum sequence length. + FineTunePreviewMessageError: + type: object + description: Error response with a message field returned by the fine-tuning API layer. + required: + - message + properties: + message: + type: string + description: Human-readable error message. + FineTunePreviewDetailError: + type: object + description: Error response with a detail field returned by the preview tokenization service. + required: + - detail + properties: + detail: + type: string + description: Human-readable error detail. FineTuneModelLimits: type: object description: Model limits for fine-tuning. required: - model_name + - lora_training - max_num_epochs - max_num_evals + - max_num_checkpoints - max_learning_rate - min_learning_rate + - supports_full_training - supports_vision - supports_tools - supports_reasoning - merge_output_lora + - min_max_seq_length + - max_seq_length_sft + - max_seq_length_dpo + - default_gradient_accumulation_steps properties: model_name: type: string @@ -13438,6 +20382,9 @@ components: min_learning_rate: type: number description: Minimum learning rate. + supports_full_training: + type: boolean + description: Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA fine-tuning is available and the full_training limits are reported as zero. supports_vision: type: boolean description: Whether the model supports vision/multimodal inputs. @@ -13449,7 +20396,22 @@ components: description: Whether the model supports reasoning. merge_output_lora: type: boolean - description: Whether to merge the output LoRA. + description: Whether a merged checkpoint (the base model with the trained LoRA adapter fused in) is produced for LoRA fine-tunes of this model, in addition to the standalone adapter. + default_gradient_accumulation_steps: + type: integer + description: Default gradient accumulation steps used when a fine-tune request omits the value or sets it to 0. + max_num_checkpoints: + type: integer + description: Maximum number of checkpoints that can be saved during a fine-tuning job. + min_max_seq_length: + type: integer + description: Minimum value allowed for the max_seq_length hyperparameter. + max_seq_length_sft: + type: integer + description: Maximum sequence length supported for SFT training. + max_seq_length_dpo: + type: integer + description: Maximum sequence length supported for DPO training. FinetuneJobStatus: type: string enum: @@ -13462,6 +20424,7 @@ components: - cancelled - error - completed + FinetuneEventLevels: type: string enum: @@ -13500,6 +20463,8 @@ components: - job_restarted - refund - warning + - early_stopped + FinetuneTruncatedList: type: object required: @@ -13525,15 +20490,6 @@ components: - created_at - message - type - - param_count - - token_count - - total_steps - - wandb_url - - step - - checkpoint_path - - model_path - - training_offset - - hash properties: object: description: The object type, which is always `fine-tune-event`. @@ -13561,10 +20517,15 @@ components: type: string model_path: type: string - training_offset: + early_stopping_best_step: type: integer - hash: - type: string + nullable: true + description: > + For early_stopped events, the selected best-checkpoint step when a finite best metric exists. If early_stopping_best_metric_value is null, this is the halt step. + early_stopping_best_metric_value: + type: number + nullable: true + description: For early_stopped events, the best validation loss observed. Null if no improving evaluation was recorded. FineTuneProgress: type: object description: Progress information for a fine-tuning job @@ -13577,9 +20538,7 @@ components: description: Whether time estimate is available seconds_remaining: type: integer - description: >- - Estimated time remaining in seconds for the fine-tuning job to next - state + description: Estimated time remaining in seconds for the fine-tuning job to next state FinetuneListCheckpoints: type: object required: @@ -13591,6 +20550,7 @@ components: $ref: '#/components/schemas/FineTuneCheckpoint' FineTuneCheckpoint: type: object + description: A checkpoint available for a fine-tuning job. required: - step - path @@ -13599,19 +20559,36 @@ components: properties: step: type: integer + description: Step represented by the checkpoint; final checkpoints use the shipped model step. created_at: type: string + description: Timestamp when the checkpoint was created. path: type: string + description: Storage path for the checkpoint artifact. checkpoint_type: type: string + description: Display label for the checkpoint, including the final or intermediate checkpoint step. + checkpoint: + type: string + enum: [model, adapter] + description: Canonical artifact selector for checkpoint download requests. + object_id: + type: string + description: Together model registry object ID for the checkpoint artifact (e.g. `ml_...`). + object_name: + type: string + description: Together model registry name for the checkpoint artifact, formatted as `/`. + object_revision_id: + type: string + description: Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`). + FullTrainingType: type: object properties: type: type: string - enum: - - Full + enum: ['Full'] required: - type LoRATrainingType: @@ -13619,30 +20596,29 @@ components: properties: type: type: string - enum: - - Lora + enum: ['Lora'] lora_r: type: integer lora_alpha: type: integer lora_dropout: type: number - format: float - default: 0 + default: 0.0 lora_trainable_modules: type: string - default: all-linear + default: 'all-linear' + description: Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE expert modules (`w_up`, `w_gate`, `w_down`) are supported on compatible models and cannot be mixed with attention modules. required: - type - lora_r - lora_alpha + TrainingMethodSFT: type: object properties: method: type: string - enum: - - sft + enum: ['sft'] train_on_inputs: oneOf: - type: boolean @@ -13651,9 +20627,7 @@ components: - auto type: boolean default: auto - description: >- - Whether to mask user messages in conversational data or prompts in - instruction data. + description: Whether to mask user messages in conversational data or prompts in instruction data. required: - method - train_on_inputs @@ -13662,16 +20636,13 @@ components: properties: method: type: string - enum: - - dpo + enum: ['dpo'] dpo_beta: type: number - format: float default: 0.1 rpo_alpha: type: number - format: float - default: 0 + default: 0.0 dpo_normalize_logratios_by_length: type: boolean default: false @@ -13680,18 +20651,17 @@ components: default: false simpo_gamma: type: number - format: float - default: 0 + default: 0.0 required: - method + MultimodalParams: type: object properties: train_vision: type: boolean - description: >- - Whether to train the vision encoder of the model. Only available for - multimodal models. + description: Whether to train the vision encoder of the model. Only available for multimodal models. + LRScheduler: type: object properties: @@ -13711,12 +20681,10 @@ components: properties: min_lr_ratio: type: number - format: float - default: 0 + default: 0.0 description: The ratio of the final learning rate to the peak learning rate num_cycles: type: number - format: float default: 0.5 description: Number or fraction of cycles for the cosine learning rate scheduler required: @@ -13727,9 +20695,9 @@ components: properties: min_lr_ratio: type: number - format: float - default: 0 + default: 0.0 description: The ratio of the final learning rate to the peak learning rate + Autoscaling: type: object description: Configuration for automatic scaling of replicas based on demand. @@ -13739,18 +20707,15 @@ components: properties: min_replicas: type: integer - format: int32 - description: >- - The minimum number of replicas to maintain, even when there is no - load + description: The minimum number of replicas to maintain, even when there is no load examples: - 2 max_replicas: type: integer - format: int32 description: The maximum number of replicas to scale up to under load examples: - 5 + HardwareSpec: type: object description: Detailed specifications of a hardware configuration @@ -13772,16 +20737,15 @@ components: - sxm gpu_memory: type: number - format: float description: Amount of GPU memory in GB examples: - 80 gpu_count: type: integer - format: int32 description: Number of GPUs in this configuration examples: - 2 + EndpointPricing: type: object description: Pricing details for using an endpoint @@ -13790,10 +20754,10 @@ components: properties: cents_per_minute: type: number - format: float description: Cost per minute of endpoint uptime in cents examples: - 5.42 + HardwareAvailability: type: object description: Indicates the current availability status of a hardware configuration @@ -13807,6 +20771,7 @@ components: - available - unavailable - insufficient + HardwareWithStatus: type: object description: Hardware configuration details with optional availability status @@ -13835,6 +20800,7 @@ components: type: string format: date-time description: Timestamp of when the hardware status was last updated + CreateEndpointRequest: type: object required: @@ -13876,17 +20842,13 @@ components: example: STARTED inactive_timeout: type: integer - description: >- - The number of minutes of inactivity after which the endpoint stops - automatically. Set to null, omit, or set to 0 to disable automatic - timeout. + description: The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout. nullable: true example: 60 availability_zone: type: string - description: >- - Create the endpoint in a specified availability zone (e.g., - us-central-4b) + description: Create the endpoint in a specified availability zone (e.g., us-central-4b) + DedicatedEndpoint: type: object description: Details about a dedicated endpoint deployment @@ -13955,6 +20917,7 @@ components: format: date-time description: Timestamp when the endpoint was created example: 2025-02-04T10:43:55.405Z + ListEndpoint: type: object description: Details about an endpoint when listed via the list endpoint @@ -14010,6 +20973,7 @@ components: format: date-time description: Timestamp when the endpoint was created example: 2024-02-28T21:34:35.444Z + DisplayorExecuteOutput: properties: data: @@ -14056,17 +21020,17 @@ components: - type - data title: DisplayorExecuteOutput + Error: oneOf: - type: string - additionalProperties: true type: object title: Error + ErrorOutput: title: ErrorOutput - description: >- - Errors and exceptions that occurred. If this output type is present, - your code did not execute successfully. + description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. properties: data: type: string @@ -14077,6 +21041,7 @@ components: required: - type - data + ExecuteRequest: title: ExecuteRequest required: @@ -14084,21 +21049,17 @@ components: - code properties: code: - description: Code snippet to execute. - example: print('Hello, world!') + description: 'Code snippet to execute.' + example: "print('Hello, world!')" type: string files: - description: >- - Files to upload to the session. If present, files are uploaded - before executing the given code. + description: Files to upload to the session. If present, files are uploaded before executing the given code. items: properties: content: type: string encoding: - description: >- - Encoding of the file content. Use `string` for text files such - as code, and `base64` for binary files, such as images. + description: Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images. enum: - string - base64 @@ -14113,41 +21074,30 @@ components: type: array language: default: python - description: >- - Programming language for the code to execute. Currently only - supports Python. + description: Programming language for the code to execute. Currently only supports Python. enum: - python session_id: - description: >- - Identifier of the current session. Used to make follow-up calls. - Returns an error if the session does not belong to the caller or has - expired. + description: Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired. example: ses_abcDEF123 nullable: false type: string + ExecuteResponse: title: ExecuteResponse type: object - description: >- - The result of the execution. If successful, `data` contains the result - and `errors` is null. If unsuccessful, `data` is null and `errors` - contains the errors. + description: 'The result of the execution. If successful, `data` contains the result and `errors` is null. If unsuccessful, `data` is null and `errors` contains the errors.' oneOf: - title: SuccessfulExecution type: object - required: - - data - - errors + required: [data, errors] properties: errors: type: 'null' data: type: object nullable: false - required: - - session_id - - outputs + required: [session_id, outputs] properties: outputs: type: array @@ -14158,9 +21108,7 @@ components: - title: StreamOutput description: Outputs that were printed to stdout or stderr type: object - required: - - type - - data + required: [type, data] properties: type: enum: @@ -14169,10 +21117,7 @@ components: type: string data: type: string - - description: >- - Errors and exceptions that occurred. If this output - type is present, your code did not execute - successfully. + - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. properties: data: type: string @@ -14236,9 +21181,7 @@ components: title: InterpreterOutput session_id: type: string - description: >- - Identifier of the current session. Used to make follow-up - calls. + description: Identifier of the current session. Used to make follow-up calls. example: ses_abcDEF123 nullable: false status: @@ -14248,9 +21191,7 @@ components: description: Status of the execution. Currently only supports success. - title: FailedExecution type: object - required: - - data - - errors + required: [data, errors] properties: data: type: 'null' @@ -14262,6 +21203,7 @@ components: - type: string - type: object additionalProperties: true + InterpreterOutput: discriminator: propertyName: type @@ -14279,9 +21221,7 @@ components: - type - data title: StreamOutput - - description: >- - Errors and exceptions that occurred. If this output type is present, - your code did not execute successfully. + - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. properties: data: type: string @@ -14339,6 +21279,7 @@ components: - data title: DisplayorExecuteOutput title: InterpreterOutput + Response: properties: errors: @@ -14351,6 +21292,7 @@ components: type: array title: Response type: object + SessionListResponse: allOf: - properties: @@ -14398,6 +21340,7 @@ components: type: object title: SessionListResponse type: object + StreamOutput: description: Outputs that were printed to stdout or stderr properties: @@ -14412,11 +21355,10 @@ components: - type - data title: StreamOutput + CreateBatchRequest: type: object - required: - - endpoint - - input_file_id + required: [endpoint, input_file_id] properties: endpoint: type: string @@ -14424,33 +21366,28 @@ components: - /v1/chat/completions - /v1/audio/transcriptions - /v1/audio/translations - description: > - The endpoint to use for batch processing. Each line of the uploaded - input file is dispatched against this endpoint. - + description: | + The endpoint to use for batch processing. Each line of the uploaded input file is dispatched against this endpoint. - `/v1/chat/completions` — chat completion batches - - - `/v1/audio/transcriptions` — audio transcription batches (e.g. - `openai/whisper-large-v3`) - + - `/v1/audio/transcriptions` — audio transcription batches (e.g. `openai/whisper-large-v3`) - `/v1/audio/translations` — audio translation batches - example: /v1/chat/completions + example: '/v1/chat/completions' input_file_id: type: string description: ID of the uploaded input file containing batch requests - example: file-abc123def456ghi789 + example: 'file-abc123def456ghi789' completion_window: type: string description: Time window for batch completion (optional) - example: 24h + example: '24h' priority: type: integer description: Priority for batch processing (optional) example: 1 model_id: type: string - description: Model to use for processing batch requests - example: Qwen/Qwen3.5-9B + description: 'Model to use for processing batch requests' + example: 'Qwen/Qwen3.5-9B' BatchErrorResponse: type: object properties: @@ -14469,18 +21406,18 @@ components: id: type: string format: uuid - example: 01234567-8901-2345-6789-012345678901 + example: '01234567-8901-2345-6789-012345678901' user_id: type: string - example: user_789xyz012 + example: 'user_789xyz012' input_file_id: type: string - example: file-input123abc456def + example: 'file-input123abc456def' file_size_bytes: type: integer - format: int64 + example: 1048576 - description: Size of input file in bytes + description: 'Size of input file in bytes' status: $ref: '#/components/schemas/BatchJobStatus' job_deadline: @@ -14493,22 +21430,21 @@ components: example: '2024-01-15T14:30:00Z' endpoint: type: string - example: /v1/chat/completions + example: '/v1/chat/completions' progress: type: number - format: float64 - example: 75 - description: Completion progress (0.0 to 100) + example: 75.0 + description: 'Completion progress (0.0 to 100)' model_id: type: string - example: Qwen/Qwen3.5-9B - description: Model used for processing requests + example: 'Qwen/Qwen3.5-9B' + description: 'Model used for processing requests' output_file_id: type: string - example: file-output789xyz012ghi + example: 'file-output789xyz012ghi' error_file_id: type: string - example: file-errors456def789jkl + example: 'file-errors456def789jkl' error: type: string completed_at: @@ -14524,8 +21460,9 @@ components: - FAILED - EXPIRED - CANCELLED - example: IN_PROGRESS - description: Current status of the batch job + example: 'IN_PROGRESS' + description: 'Current status of the batch job' + EvaluationTypedRequest: type: object required: @@ -14534,18 +21471,16 @@ components: properties: type: type: string - enum: - - classify - - score - - compare + enum: [classify, score, compare] description: The type of evaluation to perform - example: classify + example: 'classify' parameters: oneOf: - $ref: '#/components/schemas/EvaluationClassifyParameters' - $ref: '#/components/schemas/EvaluationScoreParameters' - $ref: '#/components/schemas/EvaluationCompareParameters' description: Type-specific parameters for the evaluation + EvaluationClassifyParameters: type: object required: @@ -14562,23 +21497,21 @@ components: type: string minItems: 2 description: List of possible classification labels - example: - - 'yes' - - 'no' + example: ['yes', 'no'] pass_labels: type: array items: type: string minItems: 1 description: List of labels that are considered passing - example: - - 'yes' + example: ['yes'] model_to_evaluate: $ref: '#/components/schemas/EvaluationModelOrString' input_data_file_path: type: string description: Data file ID - example: file-1234-aefd + example: 'file-1234-aefd' + EvaluationScoreParameters: type: object required: @@ -14592,25 +21525,23 @@ components: $ref: '#/components/schemas/EvaluationJudgeModelConfig' min_score: type: number - format: float - example: 0 + example: 0.0 description: Minimum possible score max_score: type: number - format: float - example: 10 + example: 10.0 description: Maximum possible score pass_threshold: type: number - format: float - example: 7 + example: 7.0 description: Score threshold for passing model_to_evaluate: $ref: '#/components/schemas/EvaluationModelOrString' input_data_file_path: type: string - example: file-01234567890123456789 + example: 'file-01234567890123456789' description: Data file ID + EvaluationCompareParameters: type: object required: @@ -14620,12 +21551,29 @@ components: judge: $ref: '#/components/schemas/EvaluationJudgeModelConfig' model_a: - $ref: '#/components/schemas/EvaluationModelOrString' + description: > + Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. + oneOf: + - $ref: '#/components/schemas/EvaluationModelRequest' + - type: string + description: Column name in the input data containing pre-generated responses model_b: - $ref: '#/components/schemas/EvaluationModelOrString' + description: > + Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time. + oneOf: + - $ref: '#/components/schemas/EvaluationModelRequest' + - type: string + description: Column name in the input data containing pre-generated responses input_data_file_path: type: string - description: Data file name + description: Data file ID + example: 'file-01234567890123456789' + disable_position_bias_correction: + type: boolean + default: false + description: > + When false (default), the judge runs twice per sample: once with model A's response first (original order) and once with model B's response first (flipped order). The two verdicts are reconciled to cancel out position bias. When true, only the original-order pass is run, halving judge cost and latency at the expense of position-bias correction. The result file will not contain flipped-order judge fields when this is true. + EvaluationJudgeModelConfig: type: object required: @@ -14636,55 +21584,50 @@ components: model: type: string description: Name of the judge model - example: Qwen/Qwen3.5-9B + example: 'Qwen/Qwen3.5-9B' system_template: type: string description: System prompt template for the judge - example: Imagine you are a helpful assistant + example: 'Imagine you are a helpful assistant' model_source: type: string - description: Source of the judge model. - enum: - - serverless - - dedicated - - external + description: > + Source of the judge model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers + (minimum enforced even if num_workers is set lower). + - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter). + Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers + for first-party APIs, 20 for proxy/aggregator endpoints. + enum: [serverless, dedicated, external] external_api_token: type: string - description: Bearer/API token for external judge models. + description: "Bearer/API token for the external judge model provider. Required when model_source is 'external'." external_base_url: type: string - description: >- - Base URL for external judge models. Must be OpenAI-compatible base - URL. + description: "Base URL of the external inference API for the judge. Must be OpenAI-compatible. Required when model_source is 'external'." num_workers: type: integer minimum: 1 - description: >- - Number of concurrent workers for inference requests. Overrides the - default concurrency for this model. Useful for tuning throughput - when using proxy endpoints (e.g. OpenRouter) or rate-limited - external APIs. + description: > + Number of concurrent inference workers for the judge. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here. example: 5 max_tokens: type: integer minimum: 1 - description: >- - Maximum number of tokens the judge model can generate. Defaults to - 32768. Increase for reasoning models (e.g. Gemini, o-series) that - consume output token budget for chain-of-thought. + description: "Maximum number of tokens the judge model may generate. Defaults to 32768 if omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend tokens on internal chain-of-thought before emitting the verdict JSON." example: 8192 temperature: type: number - format: float minimum: 0 maximum: 2 - description: Sampling temperature for the judge model. Defaults to 0.05. - example: 0 + description: "Sampling temperature for the judge model. Defaults to 0.05 if omitted." + example: 0.0 + EvaluationModelOrString: oneOf: - type: string - description: Field name in the input data + description: Column name in the input dataset containing pre-generated responses - $ref: '#/components/schemas/EvaluationModelRequest' + EvaluationModelRequest: type: object required: @@ -14698,74 +21641,71 @@ components: model: type: string description: Name of the model to evaluate - example: Qwen/Qwen3.5-9B + example: 'Qwen/Qwen3.5-9B' max_tokens: type: integer minimum: 1 - description: Maximum number of tokens to generate + description: Maximum number of tokens to generate. example: 512 temperature: type: number - format: float minimum: 0 maximum: 2 - description: Sampling temperature + description: Sampling temperature for generation. example: 0.7 system_template: type: string - description: System prompt template - example: Imagine you are helpful assistant + description: System prompt template. Supports Jinja2 variables referencing dataset columns. + example: 'You are a helpful assistant.' input_template: type: string - description: Input prompt template - example: Please classify {{prompt}} based on the labels below + description: User message template. Supports Jinja2 variables referencing dataset columns. + example: 'Please answer the following question: {{ question }}' model_source: type: string - description: Source of the model. - enum: - - serverless - - dedicated - - external + description: > + Source of the model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers + (minimum enforced even if num_workers is set lower). Authentication uses the requesting + user's Together API token automatically. + - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter). + Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers + for first-party APIs (OpenAI, Anthropic, Google), 20 for proxy/aggregator endpoints. + enum: [serverless, dedicated, external] external_api_token: type: string - description: Bearer/API token for external models. + description: "Bearer/API token for the external model provider. Required when model_source is 'external'." external_base_url: type: string - description: Base URL for external models. Must be OpenAI-compatible base URL + description: "Base URL of the external inference API. Must be OpenAI-compatible. Required when model_source is 'external'." num_workers: type: integer minimum: 1 - description: >- - Number of concurrent workers for inference requests. Overrides the - default concurrency for this model. Useful for tuning throughput - when using proxy endpoints (e.g. OpenRouter) or rate-limited - external APIs. + description: > + Number of concurrent inference workers. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here. example: 5 + EvaluationResponse: type: object properties: workflow_id: type: string description: The ID of the created evaluation job - example: eval-1234-1244513 + example: 'eval-1234-1244513' status: type: string - enum: - - pending + enum: [pending] description: Initial status of the job + EvaluationJob: type: object properties: workflow_id: type: string description: The evaluation job ID - example: eval-1234aedf + example: 'eval-1234aedf' type: type: string - enum: - - classify - - score - - compare + enum: [classify, score, compare] description: The type of evaluation example: classify owner_id: @@ -14773,13 +21713,7 @@ components: description: ID of the job owner (admin only) status: type: string - enum: - - pending - - queued - - running - - completed - - error - - user_error + enum: [pending, queued, running, completed, error, user_error] description: Current status of the job example: completed status_updates: @@ -14812,6 +21746,7 @@ components: type: string nullable: true description: Results of the evaluation (when completed) + EvaluationJobStatusUpdate: type: object properties: @@ -14828,24 +21763,22 @@ components: format: date-time description: When this update occurred example: '2025-07-23T17:10:04.837888Z' + EvaluationClassifyResults: type: object properties: generation_fail_count: type: number - format: integer nullable: true description: Number of failed generations. example: 0 judge_fail_count: type: number - format: integer nullable: true description: Number of failed judge generations example: 0 invalid_label_count: type: number - format: float nullable: true description: Number of invalid labels example: 0 @@ -14855,7 +21788,6 @@ components: example: file-1234-aefd pass_percentage: type: number - format: integer nullable: true description: Pecentage of pass labels. example: 10 @@ -14863,6 +21795,7 @@ components: type: string description: JSON string representing label counts example: '{"yes": 10, "no": 0}' + EvaluationScoreResults: type: object properties: @@ -14871,75 +21804,71 @@ components: properties: mean_score: type: number - format: float std_score: type: number - format: float pass_percentage: type: number - format: float generation_fail_count: type: number - format: integer nullable: true description: Number of failed generations. example: 0 judge_fail_count: type: number - format: integer nullable: true description: Number of failed judge generations example: 0 invalid_score_count: type: number - format: integer description: number of invalid scores generated from model failed_samples: type: number - format: integer description: number of failed samples generated from model result_file_id: type: string description: Data File ID example: file-1234-aefd + EvaluationCompareResults: type: object properties: - num_samples: - type: integer - description: Total number of samples compared A_wins: type: integer - description: Number of times model A won + description: Number of samples where model A was judged the winner B_wins: type: integer - description: Number of times model B won + description: Number of samples where model B was judged the winner Ties: type: integer - description: Number of ties + description: Number of samples that resulted in a tie score generation_fail_count: type: number - format: integer nullable: true - description: Number of failed generations. + description: Number of generation failures across model A and model B. example: 0 judge_fail_count: type: number - format: integer nullable: true - description: Number of failed judge generations + description: > + Number of judge inference failures. In the default two-pass mode (disable_position_bias_correction=false) this is the combined failure count from both the original-order and flipped-order judge passes. example: 0 result_file_id: type: string - description: Data File ID + description: > + File ID of the detailed output file. Each row contains the original input fields plus judge outputs. In two-pass mode the file includes both original-order and flipped-order judge fields; in single-pass mode (disable_position_bias_correction=true) only original-order fields are present. + AudioFileBinary: type: string format: binary - description: Audio file to transcribe + description: >- + Audio file uploaded as binary. Maximum upload size 500 MB (requests above this are rejected at the edge with HTTP 413). For larger payloads, host the file and submit a URL instead. + AudioFileUrl: type: string format: uri - description: Public HTTPS URL to audio file + description: >- + Public HTTPS URL the server fetches the audio from. Server-side fetch limit is 1 GB; downloads exceeding the cap fail with `file_too_large`. + CreateVideoBody: title: Create video request description: Parameters for creating a new video generation job. @@ -14975,19 +21904,13 @@ components: type: integer minimum: 10 maximum: 50 - description: >- - The number of denoising steps the model performs during video - generation. More steps typically result in higher quality output but - require longer processing time. + description: The number of denoising steps the model performs during video generation. More steps typically result in higher quality output but require longer processing time. seed: type: integer - description: >- - Seed to use in initializing the video generation. Using the same - seed allows deterministic video generation. If not provided a - random seed is generated for each request. + description: Seed to use in initializing the video generation. Using the same seed allows deterministic video generation. If not provided a random seed is generated for each request. guidance_scale: type: integer - description: "Controls how closely the video generation follows your prompt. Higher values make the model adhere more strictly to your text description, while lower values allow more creative freedom.\_guidence_scale\_affects both visual content and temporal consistency.Recommended range is 6.0-10.0 for most video models. Values above 12 may cause over-guidance artifacts or unnatural motion patterns." + description: Controls how closely the video generation follows your prompt. Higher values make the model adhere more strictly to your text description, while lower values allow more creative freedom. guidence_scale affects both visual content and temporal consistency.Recommended range is 6.0-10.0 for most video models. Values above 12 may cause over-guidance artifacts or unnatural motion patterns. output_format: $ref: '#/components/schemas/VideoOutputFormat' description: Specifies the format of the output video. Defaults to MP4. @@ -14996,39 +21919,24 @@ components: description: Compression quality. Defaults to 20. negative_prompt: type: string - description: >- - Similar to prompt, but specifies what to avoid instead of what to - include + description: Similar to prompt, but specifies what to avoid instead of what to include generate_audio: type: boolean description: Whether to generate audio for the video. media: $ref: '#/components/schemas/VideoMedia' - description: >- - Media inputs for video generation. The accepted fields depend on the - model type (e.g. i2v, r2v, t2v, videoedit). + description: Media inputs for video generation. The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit). frame_images: deprecated: true - description: >- - Deprecated: use media.frame_images instead. Array of images to guide - video generation, similar to keyframes. + description: "Deprecated: use media.frame_images instead. Array of images to guide video generation, similar to keyframes." example: - - - input_image: aac49721-1964-481a-ae78-8a4e29b91402 - frame: 0 - - input_image: c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7 - frame: 48 - - input_image: 3ad204c3-a9de-4963-8a1a-c3911e3afafe - frame: last + - [{"input_image": "aac49721-1964-481a-ae78-8a4e29b91402", "frame": 0}, {"input_image": "c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7", "frame": 48}, {"input_image": "3ad204c3-a9de-4963-8a1a-c3911e3afafe", "frame": "last"}] type: array items: $ref: '#/components/schemas/VideoFrameImageInput' reference_images: deprecated: true - description: >- - Deprecated: use media.reference_images instead. Unlike frame_images - which constrain specific timeline positions, reference images guide - the general appearance that should appear consistently across the - video. + description: "Deprecated: use media.reference_images instead. Unlike frame_images which constrain specific timeline positions, reference images guide the general appearance that should appear consistently across the video." type: array items: type: string @@ -15039,41 +21947,33 @@ components: - in_progress - completed - failed + VideoFrameImageInput: type: object - required: - - input_image + required: ['input_image'] properties: input_image: type: string description: URL path to hosted image that is used for a frame frame: - description: > - Optional param to specify where to insert the frame. If this is - omitted, the following heuristics are applied: - + description: | + Optional param to specify where to insert the frame. If this is omitted, the following heuristics are applied: - frame_images size is one, frame is first. - - If size is two, frames are first and last. - - - If size is larger, frames are first, last and evenly spaced - between. + - If size is larger, frames are first, last and evenly spaced between. anyOf: - type: number - type: string enum: - first - last + VideoMedia: type: object - description: >- - Contains all media inputs for video generation. Accepted fields depend - on the model type. + description: Contains all media inputs for video generation. Accepted fields depend on the model type. properties: frame_images: - description: >- - Array of images to guide video generation at specific timeline - positions. + description: Array of images to guide video generation at specific timeline positions. type: array items: $ref: '#/components/schemas/VideoFrameImageInput' @@ -15083,9 +21983,7 @@ components: items: $ref: '#/components/schemas/VideoRef' reference_images: - description: >- - Array of image URLs that guide the general appearance across the - video. + description: Array of image URLs that guide the general appearance across the video. type: array items: type: string @@ -15095,42 +21993,40 @@ components: items: $ref: '#/components/schemas/VideoRef' source_video: - description: >- - Source video to edit. Accepts a URL string or an object with a - "video" key. + description: Source video to edit. Accepts a URL string or an object with a "video" key. oneOf: - type: string - $ref: '#/components/schemas/VideoRef' audio_inputs: - description: >- - Array of audio inputs. Each element accepts a URL string or an - object with an "audio" key. + description: Array of audio inputs. Each element accepts a URL string or an object with an "audio" key. type: array items: oneOf: - type: string - $ref: '#/components/schemas/AudioRef' + VideoRef: type: object - required: - - video + required: ['video'] properties: video: type: string description: URL of the video. + AudioRef: type: object - required: - - audio + required: ['audio'] properties: audio: type: string description: URL of the audio. + VideoOutputFormat: type: string enum: - MP4 - WEBM + VideoJob: properties: id: @@ -15168,9 +22064,7 @@ components: required: - message outputs: - description: >- - Available upon completion, the outputs provides the cost charged and - the hosted url to access the video + description: Available upon completion, the outputs provides the cost charged and the hosted url to access the video type: object properties: cost: @@ -15195,30 +22089,22 @@ components: ContainerStatus: properties: finishedAt: - description: >- - FinishedAt is the timestamp when the container finished execution - (if terminated) + description: FinishedAt is the timestamp when the container finished execution (if terminated) type: string message: - description: >- - Message provides a human-readable message with details about the - container's status + description: Message provides a human-readable message with details about the container's status type: string name: description: Name is the name of the container type: string reason: - description: >- - Reason provides a brief machine-readable reason for the container's - current status + description: Reason provides a brief machine-readable reason for the container's current status type: string startedAt: description: StartedAt is the timestamp when the container started execution type: string status: - description: >- - Status is the current state of the container (e.g., "Running", - "Terminated", "Waiting") + description: Status is the current state of the container (e.g., "Running", "Terminated", "Waiting") type: string type: object SignedURLResponse: @@ -15229,51 +22115,35 @@ components: CreateDeploymentRequest: properties: args: - description: >- - Args overrides the container's CMD. Provide as an array of arguments - (e.g., ["python", "app.py"]) + description: Args overrides the container's CMD. Provide as an array of arguments (e.g., ["python", "app.py"]) items: type: string type: array autoscaling: - description: >- - Autoscaling configuration. Example: {"metric": - "QueueBacklogPerWorker", "target": 1.01} to scale based on queue - backlog. Omit or set to null to disable autoscaling + description: 'Autoscaling configuration. Example: {"metric": "QueueBacklogPerWorker", "target": 1.01} to scale based on queue backlog. Omit or set to null to disable autoscaling' oneOf: - - $ref: '#/components/schemas/HTTPAutoscalingConfig' - - $ref: '#/components/schemas/QueueAutoscalingConfig' - - $ref: '#/components/schemas/CustomMetricAutoscalingConfig' + - $ref: "#/components/schemas/HTTPAutoscalingConfig" + - $ref: "#/components/schemas/QueueAutoscalingConfig" + - $ref: "#/components/schemas/CustomMetricAutoscalingConfig" command: - description: >- - Command overrides the container's ENTRYPOINT. Provide as an array - (e.g., ["/bin/sh", "-c"]) + description: Command overrides the container's ENTRYPOINT. Provide as an array (e.g., ["/bin/sh", "-c"]) items: type: string type: array cpu: - description: >- - CPU is the number of CPU cores to allocate per container instance - (e.g., 0.1 = 100 milli cores) + description: CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 = 100 milli cores) minimum: 0.1 type: number description: - description: >- - Description is an optional human-readable description of your - deployment + description: Description is an optional human-readable description of your deployment type: string environment_variables: - description: >- - EnvironmentVariables is a list of environment variables to set in - the container. Each must have a name and either a value or - value_from_secret + description: EnvironmentVariables is a list of environment variables to set in the container. Each must have a name and either a value or value_from_secret items: - $ref: '#/components/schemas/EnvironmentVariable' + $ref: "#/components/schemas/EnvironmentVariable" type: array gpu_count: - description: >- - GPUCount is the number of GPUs to allocate per container instance. - Defaults to 0 if not specified + description: GPUCount is the number of GPUs to allocate per container instance. Defaults to 0 if not specified type: integer gpu_type: description: GPUType specifies the GPU hardware to use (e.g., "h100-80gb"). @@ -15284,61 +22154,42 @@ components: - b200-192gb type: string health_check_path: - description: >- - HealthCheckPath is the HTTP path for health checks (e.g., - "/health"). If set, the platform checks this endpoint to determine - container health. + description: HealthCheckPath is the HTTP path for health checks (e.g., "/health"). If set, the platform checks this endpoint to determine container health. type: string image: description: Image is the container image to deploy from registry.together.ai. type: string max_replicas: - description: >- - MaxReplicas is the maximum number of container instances. Defaults - to MinReplicas if not set. + description: MaxReplicas is the maximum number of container instances. Defaults to MinReplicas if not set. type: integer memory: - description: >- - Memory is the amount of RAM to allocate per container instance in - GiB (e.g., 0.5 = 512MiB) + description: Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5 = 512MiB) maximum: 1000 type: number min_replicas: - description: >- - MinReplicas is the minimum number of container instances to run. - Defaults to 1 if not specified + description: MinReplicas is the minimum number of container instances to run. Defaults to 1 if not specified type: integer name: - description: >- - Name is the unique identifier for your deployment. Must contain only - alphanumeric characters, underscores, or hyphens (1-100 characters) + description: Name is the unique identifier for your deployment. Must contain only alphanumeric characters, underscores, or hyphens (1-100 characters) maxLength: 100 minLength: 1 type: string port: - description: >- - Port is the container port your application listens on (e.g., 8080 - for web servers). Required if your application serves traffic + description: Port is the container port your application listens on (e.g., 8080 for web servers). Required if your application serves traffic maximum: 65535 minimum: 1 type: integer storage: - description: >- - Storage is the amount of ephemeral disk storage to allocate per - container instance (e.g., 10 = 10GiB) + description: Storage is the amount of ephemeral disk storage to allocate per container instance (e.g., 10 = 10GiB) maximum: 400 type: integer termination_grace_period_seconds: - description: >- - TerminationGracePeriodSeconds is the time in seconds to wait for - graceful shutdown before forcefully terminating the replica + description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica type: integer volumes: - description: >- - Volumes is a list of volume mounts to attach to the container. Each - mount must reference an existing volume by name + description: Volumes is a list of volume mounts to attach to the container. Each mount must reference an existing volume by name items: - $ref: '#/components/schemas/VolumeMount' + $ref: "#/components/schemas/VolumeMount" type: array required: - gpu_type @@ -15348,28 +22199,19 @@ components: CreateSecretRequest: properties: description: - description: >- - Description is an optional human-readable description of the - secret's purpose (max 500 characters) + description: Description is an optional human-readable description of the secret's purpose (max 500 characters) maxLength: 500 type: string name: - description: >- - Name is the unique identifier for the secret. Can contain - alphanumeric characters, underscores, hyphens, forward slashes, and - periods (1-100 characters) + description: Name is the unique identifier for the secret. Can contain alphanumeric characters, underscores, hyphens, forward slashes, and periods (1-100 characters) maxLength: 100 minLength: 1 type: string project_id: - description: >- - ProjectID is ignored - the project is automatically determined from - your authentication + description: ProjectID is ignored - the project is automatically determined from your authentication type: string value: - description: >- - Value is the sensitive data to store securely (e.g., API keys, - passwords, tokens). Encrypted at rest. + description: Value is the sensitive data to store securely (e.g., API keys, passwords, tokens). Encrypted at rest. minLength: 1 type: string required: @@ -15380,7 +22222,7 @@ components: properties: content: allOf: - - $ref: '#/components/schemas/VolumeContentRequest' + - $ref: "#/components/schemas/VolumeContentRequest" description: Content specifies the content configuration for this volume name: description: Name is the unique identifier for the volume within the project @@ -15389,7 +22231,7 @@ components: type: string type: allOf: - - $ref: '#/components/schemas/VolumeType' + - $ref: "#/components/schemas/VolumeType" description: Type is the volume type (currently only "readOnly" is supported) required: - content @@ -15401,7 +22243,7 @@ components: data: description: Data is the array of deployment items items: - $ref: '#/components/schemas/DeploymentResponseItem' + $ref: "#/components/schemas/DeploymentResponseItem" type: array object: description: The object type, which is always `list`. @@ -15422,9 +22264,7 @@ components: type: string type: array autoscaling: - description: >- - Autoscaling contains autoscaling configuration parameters for this - deployment. Omitted when autoscaling is disabled (nil) + description: Autoscaling contains autoscaling configuration parameters for this deployment. Omitted when autoscaling is disabled (nil) oneOf: - $ref: '#/components/schemas/HTTPAutoscalingConfig' - $ref: '#/components/schemas/QueueAutoscalingConfig' @@ -15435,40 +22275,28 @@ components: type: string type: array cpu: - description: >- - CPU is the amount of CPU resource allocated to each replica in cores - (fractional value is allowed) + description: CPU is the amount of CPU resource allocated to each replica in cores (fractional value is allowed) type: number created_at: description: CreatedAt is the ISO8601 timestamp when this deployment was created type: string format: date-time description: - description: >- - Description provides a human-readable explanation of the - deployment's purpose or content + description: Description provides a human-readable explanation of the deployment's purpose or content type: string desired_replicas: - description: >- - DesiredReplicas is the number of replicas that the orchestrator is - targeting + description: DesiredReplicas is the number of replicas that the orchestrator is targeting type: integer environment_variables: - description: >- - EnvironmentVariables is a list of environment variables set in the - container + description: EnvironmentVariables is a list of environment variables set in the container items: - $ref: '#/components/schemas/EnvironmentVariable' + $ref: "#/components/schemas/EnvironmentVariable" type: array gpu_count: - description: >- - GPUCount is the number of GPUs allocated to each replica in this - deployment + description: GPUCount is the number of GPUs allocated to each replica in this deployment type: integer gpu_type: - description: >- - GPUType specifies the type of GPU requested (if any) for this - deployment + description: GPUType specifies the type of GPU requested (if any) for this deployment enum: - h100-80gb - h100-40gb-mig @@ -15476,9 +22304,7 @@ components: - b200-192gb type: string health_check_path: - description: >- - HealthCheckPath is the HTTP path used for health checks of the - application + description: HealthCheckPath is the HTTP path used for health checks of the application type: string id: description: ID is the unique identifier of the deployment @@ -15487,19 +22313,13 @@ components: description: Image specifies the container image used for this deployment type: string max_replicas: - description: >- - MaxReplicas is the maximum number of replicas to run for this - deployment + description: MaxReplicas is the maximum number of replicas to run for this deployment type: integer memory: - description: >- - Memory is the amount of memory allocated to each replica in GiB - (fractional value is allowed) + description: Memory is the amount of memory allocated to each replica in GiB (fractional value is allowed) type: number min_replicas: - description: >- - MinReplicas is the minimum number of replicas to run for this - deployment + description: MinReplicas is the minimum number of replicas to run for this deployment type: integer name: description: Name is the name of the deployment @@ -15511,23 +22331,17 @@ components: description: Port is the container port that the deployment exposes type: integer ready_replicas: - description: >- - ReadyReplicas is the current number of replicas that are in the - Ready state + description: ReadyReplicas is the current number of replicas that are in the Ready state type: integer replica_events: additionalProperties: - $ref: '#/components/schemas/ReplicaEvent' - description: >- - ReplicaEvents is a mapping of replica names or IDs to their status - events + $ref: "#/components/schemas/ReplicaEvent" + description: ReplicaEvents is a mapping of replica names or IDs to their status events type: object status: allOf: - - $ref: '#/components/schemas/DeploymentStatus' - description: >- - Status represents the overall status of the deployment (e.g., - Updating, Scaling, Ready, Failed) + - $ref: "#/components/schemas/DeploymentStatus" + description: Status represents the overall status of the deployment (e.g., Updating, Scaling, Ready, Failed) enum: - Updating - Scaling @@ -15535,25 +22349,19 @@ components: - Failed - ScaledToZero storage: - description: >- - Storage is the amount of storage (in MB or units as defined by the - platform) allocated to each replica + description: Storage is the amount of storage (in MB or units as defined by the platform) allocated to each replica type: integer termination_grace_period_seconds: - description: >- - TerminationGracePeriodSeconds is the time in seconds to wait for - graceful shutdown before forcefully terminating the replica + description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica type: integer updated_at: - description: >- - UpdatedAt is the ISO8601 timestamp when this deployment was last - updated + description: UpdatedAt is the ISO8601 timestamp when this deployment was last updated type: string format: date-time volumes: description: Volumes is a list of volume mounts for this deployment items: - $ref: '#/components/schemas/VolumeMount' + $ref: "#/components/schemas/VolumeMount" type: array type: object DeploymentStatus: @@ -15573,30 +22381,19 @@ components: EnvironmentVariable: properties: name: - description: >- - Name is the environment variable name (e.g., "DATABASE_URL"). Must - start with a letter or underscore, followed by letters, numbers, or - underscores + description: Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a letter or underscore, followed by letters, numbers, or underscores type: string value: - description: >- - Value is the plain text value for the environment variable. Use this - for non-sensitive values. Either Value or ValueFromSecret must be - set, but not both + description: Value is the plain text value for the environment variable. Use this for non-sensitive values. Either Value or ValueFromSecret must be set, but not both type: string value_from_secret: - description: >- - ValueFromSecret references a secret by name or ID to use as the - value. Use this for sensitive values like API keys or passwords. - Either Value or ValueFromSecret must be set, but not both + description: ValueFromSecret references a secret by name or ID to use as the value. Use this for sensitive values like API keys or passwords. Either Value or ValueFromSecret must be set, but not both type: string required: - name type: object HTTPAutoscalingConfig: - description: >- - Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration - metrics + description: Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics properties: metric: description: Metric must be HTTPTotalRequests or HTTPAvgRequestDuration @@ -15606,9 +22403,7 @@ components: example: HTTPTotalRequests type: string target: - description: >- - Target is the threshold value. Default: 100 for HTTPTotalRequests, - 500 (ms) for HTTPAvgRequestDuration + description: 'Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for HTTPAvgRequestDuration' example: 100 type: number time_interval_minutes: @@ -15626,9 +22421,7 @@ components: example: QueueBacklogPerWorker type: string model: - description: >- - Model overrides the model name for queue status lookup. Defaults to - the deployment app name + description: Model overrides the model name for queue status lookup. Defaults to the deployment app name type: string target: description: 'Target is the threshold value. Default: 1.01' @@ -15639,9 +22432,7 @@ components: description: Autoscaling config for CustomMetric metric properties: custom_metric_name: - description: >- - CustomMetricName is the Prometheus metric name. Required. Must match - [a-zA-Z_:][a-zA-Z0-9_:]* + description: CustomMetricName is the Prometheus metric name. Must match [a-zA-Z_:][a-zA-Z0-9_:]* example: my_custom_metric type: string metric: @@ -15673,9 +22464,7 @@ components: description: Message is a human-readable description of the event type: string reason: - description: >- - Reason is a brief machine-readable reason for this event (e.g., - "Pulling", "Started", "Failed") + description: Reason is a brief machine-readable reason for this event (e.g., "Pulling", "Started", "Failed") type: string type: object ListSecretsResponse: @@ -15683,7 +22472,7 @@ components: data: description: Data is the array of secret items items: - $ref: '#/components/schemas/SecretResponseItem' + $ref: "#/components/schemas/SecretResponseItem" type: array object: description: The object type, which is always `list`. @@ -15694,7 +22483,7 @@ components: data: description: Data is the array of volume items items: - $ref: '#/components/schemas/VolumeResponseItem' + $ref: "#/components/schemas/VolumeResponseItem" type: array object: description: The object type, which is always `list`. @@ -15706,44 +22495,28 @@ components: description: Image is the container image used for this replica type: string replica_ready_since: - description: >- - ReplicaReadySince is the timestamp when the replica became ready to - serve traffic + description: ReplicaReadySince is the timestamp when the replica became ready to serve traffic type: string replica_status: - description: >- - ReplicaStatus is the current status of the replica (e.g., "Running", - "Waiting", "Terminated") + description: ReplicaStatus is the current status of the replica (e.g., "Running", "Waiting", "Terminated") type: string replica_status_message: - description: >- - ReplicaStatusMessage provides a human-readable message explaining - the replica's status + description: ReplicaStatusMessage provides a human-readable message explaining the replica's status type: string replica_status_reason: - description: >- - ReplicaStatusReason provides a brief machine-readable reason for the - replica's status + description: ReplicaStatusReason provides a brief machine-readable reason for the replica's status type: string revision_id: - description: >- - RevisionID is the deployment revision ID associated with this - replica + description: RevisionID is the deployment revision ID associated with this replica type: string volume_preload_completed_at: - description: >- - VolumePreloadCompletedAt is the timestamp when the volume preload - completed + description: VolumePreloadCompletedAt is the timestamp when the volume preload completed type: string volume_preload_started_at: - description: >- - VolumePreloadStartedAt is the timestamp when the volume preload - started + description: VolumePreloadStartedAt is the timestamp when the volume preload started type: string volume_preload_status: - description: >- - VolumePreloadStatus is the status of the volume preload (e.g., - "InProgress", "Completed", "Failed") + description: VolumePreloadStatus is the status of the volume preload (e.g., "InProgress", "Completed", "Failed") type: string type: object SecretResponseItem: @@ -15776,44 +22549,32 @@ components: UpdateDeploymentRequest: properties: args: - description: >- - Args overrides the container's CMD. Provide as an array of arguments - (e.g., ["python", "app.py"]) + description: Args overrides the container's CMD. Provide as an array of arguments (e.g., ["python", "app.py"]) items: type: string type: array autoscaling: - description: >- - Autoscaling configuration for the deployment. Set to {} to disable - autoscaling + description: Autoscaling configuration for the deployment. Set to {} to disable autoscaling oneOf: - - $ref: '#/components/schemas/HTTPAutoscalingConfig' - - $ref: '#/components/schemas/QueueAutoscalingConfig' - - $ref: '#/components/schemas/CustomMetricAutoscalingConfig' + - $ref: "#/components/schemas/HTTPAutoscalingConfig" + - $ref: "#/components/schemas/QueueAutoscalingConfig" + - $ref: "#/components/schemas/CustomMetricAutoscalingConfig" command: - description: >- - Command overrides the container's ENTRYPOINT. Provide as an array - (e.g., ["/bin/sh", "-c"]) + description: Command overrides the container's ENTRYPOINT. Provide as an array (e.g., ["/bin/sh", "-c"]) items: type: string type: array cpu: - description: >- - CPU is the number of CPU cores to allocate per container instance - (e.g., 0.1 = 100 milli cores) + description: CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 = 100 milli cores) minimum: 0.1 type: number description: - description: >- - Description is an optional human-readable description of your - deployment + description: Description is an optional human-readable description of your deployment type: string environment_variables: - description: >- - EnvironmentVariables is a list of environment variables to set in - the container. Replaces all existing environment variables. + description: EnvironmentVariables is a list of environment variables to set in the container. Replaces all existing environment variables. items: - $ref: '#/components/schemas/EnvironmentVariable' + $ref: "#/components/schemas/EnvironmentVariable" type: array gpu_count: description: GPUCount is the number of GPUs to allocate per container instance @@ -15827,86 +22588,60 @@ components: - b200-192gb type: string health_check_path: - description: >- - HealthCheckPath is the HTTP path for health checks (e.g., - "/health"). Set to empty string to disable health checks + description: HealthCheckPath is the HTTP path for health checks (e.g., "/health"). Set to empty string to disable health checks type: string image: description: Image is the container image to deploy from registry.together.ai. type: string max_replicas: - description: >- - MaxReplicas is the maximum number of replicas that can be scaled up - to. + description: MaxReplicas is the maximum number of replicas that can be scaled up to. type: integer memory: - description: >- - Memory is the amount of RAM to allocate per container instance in - GiB (e.g., 0.5 = 512MiB) + description: Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5 = 512MiB) maximum: 1000 type: number min_replicas: description: MinReplicas is the minimum number of replicas to run type: integer name: - description: >- - Name is the new unique identifier for your deployment. Must contain - only alphanumeric characters, underscores, or hyphens (1-100 - characters) + description: Name is the new unique identifier for your deployment. Must contain only alphanumeric characters, underscores, or hyphens (1-100 characters) maxLength: 100 minLength: 1 type: string port: - description: >- - Port is the container port your application listens on (e.g., 8080 - for web servers) + description: Port is the container port your application listens on (e.g., 8080 for web servers) maximum: 65535 minimum: 1 type: integer storage: - description: >- - Storage is the amount of ephemeral disk storage to allocate per - container instance (e.g., 10 = 10GiB) + description: Storage is the amount of ephemeral disk storage to allocate per container instance (e.g., 10 = 10GiB) maximum: 400 type: integer termination_grace_period_seconds: - description: >- - TerminationGracePeriodSeconds is the time in seconds to wait for - graceful shutdown before forcefully terminating the replica + description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica type: integer volumes: - description: >- - Volumes is a list of volume mounts to attach to the container. - Replaces all existing volumes. + description: Volumes is a list of volume mounts to attach to the container. Replaces all existing volumes. items: - $ref: '#/components/schemas/VolumeMount' + $ref: "#/components/schemas/VolumeMount" type: array type: object UpdateSecretRequest: properties: description: - description: >- - Description is an optional human-readable description of the - secret's purpose (max 500 characters) + description: Description is an optional human-readable description of the secret's purpose (max 500 characters) maxLength: 500 type: string name: - description: >- - Name is the new unique identifier for the secret. Can contain - alphanumeric characters, underscores, hyphens, forward slashes, and - periods (1-100 characters) + description: Name is the new unique identifier for the secret. Can contain alphanumeric characters, underscores, hyphens, forward slashes, and periods (1-100 characters) maxLength: 100 minLength: 1 type: string project_id: - description: >- - ProjectID is ignored - the project is automatically determined from - your authentication + description: ProjectID is ignored - the project is automatically determined from your authentication type: string value: - description: >- - Value is the new sensitive data to store securely. Updating this - replaces the existing secret value. + description: Value is the new sensitive data to store securely. Updating this replaces the existing secret value. minLength: 1 type: string type: object @@ -15914,33 +22649,26 @@ components: properties: content: allOf: - - $ref: '#/components/schemas/VolumeContentRequest' + - $ref: "#/components/schemas/VolumeContentRequest" description: Content specifies the new content to preload to this volume. name: description: Name is the new unique identifier for the volume within the project type: string type: allOf: - - $ref: '#/components/schemas/VolumeType' + - $ref: "#/components/schemas/VolumeType" description: Type is the new volume type (currently only "readOnly" is supported) type: object VolumeMount: properties: mount_path: - description: >- - MountPath is the path in the container where the volume mounts - (e.g., "/data"). + description: MountPath is the path in the container where the volume mounts (e.g., "/data"). type: string name: - description: >- - Name is the name of the volume to mount. Must reference an existing - volume by name or ID + description: Name is the name of the volume to mount. Must reference an existing volume by name or ID type: string version: - description: >- - Version is the volume version to mount. On create, defaults to the - latest version. On update, defaults to the currently mounted - version. + description: Version is the volume version to mount. On create, defaults to the latest version. On update, defaults to the currently mounted version. type: integer required: - mount_path @@ -15960,9 +22688,7 @@ components: description: ID is the unique identifier for this volume type: string mounted_by: - description: >- - MountedBy is the list of deployment IDs currently mounting current - volume version + description: MountedBy is the list of deployment IDs currently mounting current volume version items: type: string type: array @@ -15981,9 +22707,7 @@ components: version_history: additionalProperties: $ref: '#/components/schemas/VersionHistoryItem' - description: >- - VersionHistory contains previous versions of this volume, keyed by - version number + description: VersionHistory contains previous versions of this volume, keyed by version number type: object type: object VersionHistoryItem: @@ -16002,15 +22726,11 @@ components: description: Content specifies the new content to preload to this volume. properties: source_prefix: - description: >- - SourcePrefix is the file path prefix for the content to be preloaded - into the volume + description: SourcePrefix is the file path prefix for the content to be preloaded into the volume example: models/ type: string type: - description: >- - Type is the content type (currently only "files" is supported which - allows preloading files uploaded via Files API into the volume) + description: Type is the content type (currently only "files" is supported which allows preloading files uploaded via Files API into the volume) enum: - files example: files @@ -16019,23 +22739,17 @@ components: VolumeContent: properties: files: - description: >- - Files is the list of files to preload into the volume, if the volume - content type is "files". + description: Files is the list of files to preload into the volume, if the volume content type is "files". items: $ref: '#/components/schemas/FileInfo' type: array uniqueItems: false source_prefix: - description: >- - SourcePrefix is the file path prefix for the content to be preloaded - into the volume + description: SourcePrefix is the file path prefix for the content to be preloaded into the volume example: models/ type: string type: - description: >- - Type is the content type (currently only "files" is supported which - allows preloading files uploaded via Files API into the volume) + description: Type is the content type (currently only "files" is supported which allows preloading files uploaded via Files API into the volume) enum: - files example: files @@ -16060,6 +22774,7 @@ components: x-enum-varnames: - VolumeTypeReadOnly QueueError: + description: Error response returned by queue endpoints. properties: code: description: Machine-readable error code @@ -16075,6 +22790,7 @@ components: type: string type: object QueueMetricsResponse: + description: Queue job counts for a model. type: object required: - messages_running @@ -16091,6 +22807,7 @@ components: description: Total number of active jobs (waiting + running) type: integer QueueCancelRequest: + description: Request to cancel a queued job. properties: model: description: Model identifier the job was submitted to @@ -16103,6 +22820,7 @@ components: - request_id type: object QueueCancelResponse: + description: Status returned after a cancel attempt. type: object required: - status @@ -16118,22 +22836,40 @@ components: - running - done - failed + QueueClearRequest: + description: Request to clear pending jobs for a model. + properties: + model: + description: Model identifier whose pending jobs should be canceled + type: string + required: + - model + type: object + QueueClearResponse: + description: Count of pending jobs canceled by the clear operation. + type: object + required: + - canceled_count + properties: + canceled_count: + description: Number of pending jobs that were canceled + type: integer QueueJobRequest: + description: Request to submit a job to the queue. properties: info: description: | - Arbitrary JSON metadata stored with the job and returned in status - responses. The model and system may add or update keys during - processing. + Arbitrary JSON metadata stored with the job. Returned in status + responses, where the model and system may have added or modified + keys (e.g. progress). additionalProperties: true type: object model: description: Required model identifier + example: my-queue-model type: string payload: - description: >- - Freeform model input. Passed unchanged to the model. Contents are - model-specific. + description: Freeform model input. Passed unchanged to the model. Contents are model-specific. additionalProperties: true type: object priority: @@ -16148,16 +22884,16 @@ components: - payload type: object QueueJobResponse: + description: Response returned after queueing a job. properties: - error: - $ref: '#/components/schemas/QueueError' requestId: - description: >- - Unique identifier for the submitted job. Use this to poll status or - cancel. + description: Unique identifier for the submitted job. Use this to poll status or cancel. type: string + required: + - requestId type: object QueueJobStatusResponse: + description: Current status and metadata for a queued job. required: - request_id - model @@ -16190,9 +22926,7 @@ components: description: Model identifier the job was submitted to type: string outputs: - description: >- - Freeform model output, populated when the job reaches done status. - Contents are model-specific. + description: Freeform model output, populated when the job reaches done status. Contents are model-specific. additionalProperties: true type: object priority: @@ -16210,9 +22944,8 @@ components: failed. Jobs explicitly failed by the model are not retried. type: integer status: - description: > - Current job status. Transitions: pending → running → done/failed. A - pending job may also be canceled. + description: | + Current job status. Transitions: pending → running → done/failed. A pending job may also be canceled. enum: - pending - running @@ -16226,3 +22959,35 @@ components: type: string type: array type: object + WhoamiResponse: + type: object + required: + - api_key_id + - project_id + - project_name + - project_slug + - organization_id + - organization_name + properties: + api_key_id: + type: string + description: The ID of the API key that authenticated the request. + project_id: + type: string + description: The ID of the project the API key is scoped to. + project_name: + type: string + description: Human-readable name of the project. + project_slug: + type: string + description: > + DNS-friendly project identifier. Used with an endpoint slug as `/` to form the `model` value in dedicated endpoint inference calls. + organization_id: + type: string + description: The ID of the organization that owns the project. + organization_name: + type: string + description: Human-readable name of the organization. + user_id: + type: string + description: The ID of the authenticated user, if available.