From e482eb7b3858b0d2b707aad139fa32b184805ef4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Apr 2026 16:18:51 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...gram.DatasetsClient.TrainDatasetModel.g.cs | 37 -- ...ram.IDatasetsClient.TrainDatasetModel.g.cs | 31 - .../Ideogram.IModelsClient.TrainModelV3.g.cs | 41 ++ ...am.IModelsClient.TrainModelV3Advanced.g.cs | 61 ++ ...inDatasetModelRequestBaseModelVersion.g.cs | 53 -- ...tModelRequestBaseModelVersionNullable.g.cs | 60 -- .../Ideogram.JsonSerializerContext.g.cs | 9 +- .../Ideogram.JsonSerializerContextTypes.g.cs | 46 +- .../Ideogram.Models.GetDatasetResponse.g.cs | 19 +- ...ogram.Models.TrainDatasetModelRequest.g.cs | 92 +-- ...inDatasetModelRequestBaseModelVersion.g.cs | 53 -- ...dels.TrainModelV3AdvancedRequest.Json.g.cs | 92 +++ ...am.Models.TrainModelV3AdvancedRequest.g.cs | 121 ++++ ...ogram.Models.TrainModelV3Request.Json.g.cs | 92 +++ .../Ideogram.Models.TrainModelV3Request.g.cs | 65 +++ .../Ideogram.ModelsClient.TrainModelV3.g.cs | 522 +++++++++++++++++ ...ram.ModelsClient.TrainModelV3Advanced.g.cs | 546 ++++++++++++++++++ .../Generated/autosdk.generated-examples.json | 26 +- src/libs/Ideogram/openapi.json | 241 ++++++-- 19 files changed, 1792 insertions(+), 415 deletions(-) create mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequestBaseModelVersion.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs index 0bb0ff0..34c1c49 100644 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs @@ -501,55 +501,18 @@ partial void ProcessTrainDatasetModelResponseContent( /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
/// Example: my-custom-model /// - /// - /// Number of training steps. Must be between 100 and 20000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64, 128, or 256. Defaults to 128. Note: lora_rank 256 requires num_chips >= 64.
- /// Example: 64 - /// - /// - /// Number of TPU chips to use. Allowed values depend on the base_model_version: V_3_1 supports 16, 32, or 64, V_4_0 supports 128.
- /// Example: 32 - /// - /// - /// Base model version to train on. Defaults to V_3_1.
- /// Default Value: V_3_1
- /// Example: V_3_1 - /// - /// - /// Exponential moving average decay rate. Must be greater than 0.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0.
- /// Example: 0.0001F - /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task TrainDatasetModelAsync( string datasetId, string modelName, - int? trainingSteps = default, - int? loraRank = default, - int? numChips = default, - global::Ideogram.TrainDatasetModelRequestBaseModelVersion? baseModelVersion = default, - double? ema = default, - double? learningRate = default, global::Ideogram.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Ideogram.TrainDatasetModelRequest { ModelName = modelName, - TrainingSteps = trainingSteps, - LoraRank = loraRank, - NumChips = numChips, - BaseModelVersion = baseModelVersion, - Ema = ema, - LearningRate = learningRate, }; return await TrainDatasetModelAsync( diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs index 3a29a99..d66ddee 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs @@ -28,43 +28,12 @@ public partial interface IDatasetsClient /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
/// Example: my-custom-model /// - /// - /// Number of training steps. Must be between 100 and 20000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64, 128, or 256. Defaults to 128. Note: lora_rank 256 requires num_chips >= 64.
- /// Example: 64 - /// - /// - /// Number of TPU chips to use. Allowed values depend on the base_model_version: V_3_1 supports 16, 32, or 64, V_4_0 supports 128.
- /// Example: 32 - /// - /// - /// Base model version to train on. Defaults to V_3_1.
- /// Default Value: V_3_1
- /// Example: V_3_1 - /// - /// - /// Exponential moving average decay rate. Must be greater than 0.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0.
- /// Example: 0.0001F - /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task TrainDatasetModelAsync( string datasetId, string modelName, - int? trainingSteps = default, - int? loraRank = default, - int? numChips = default, - global::Ideogram.TrainDatasetModelRequestBaseModelVersion? baseModelVersion = default, - double? ema = default, - double? learningRate = default, global::Ideogram.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs new file mode 100644 index 0000000..1b7b710 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs @@ -0,0 +1,41 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IModelsClient + { + /// + /// Train a custom Ideogram v3 model
+ /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainModelV3Async( + + global::Ideogram.TrainModelV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Train a custom Ideogram v3 model
+ /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. + ///
+ /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainModelV3Async( + string datasetId, + string modelName, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs new file mode 100644 index 0000000..20ad2af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs @@ -0,0 +1,61 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IModelsClient + { + /// + /// Train a custom Ideogram v3 model with advanced hyperparameters
+ /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( + + global::Ideogram.TrainModelV3AdvancedRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Train a custom Ideogram v3 model with advanced hyperparameters
+ /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. + ///
+ /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// + /// + /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
+ /// Example: 1000 + /// + /// + /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
+ /// Example: 64 + /// + /// + /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
+ /// Example: 0.999F + /// + /// + /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
+ /// Example: 0.0001F + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( + string datasetId, + string modelName, + int? trainingSteps = default, + int? loraRank = default, + double? ema = default, + double? learningRate = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersion.g.cs deleted file mode 100644 index dabe38a..0000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersion.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TrainDatasetModelRequestBaseModelVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TrainDatasetModelRequestBaseModelVersion 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::Ideogram.TrainDatasetModelRequestBaseModelVersionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TrainDatasetModelRequestBaseModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TrainDatasetModelRequestBaseModelVersion); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TrainDatasetModelRequestBaseModelVersion value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TrainDatasetModelRequestBaseModelVersionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionNullable.g.cs deleted file mode 100644 index 729218c..0000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TrainDatasetModelRequestBaseModelVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TrainDatasetModelRequestBaseModelVersion? 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::Ideogram.TrainDatasetModelRequestBaseModelVersionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TrainDatasetModelRequestBaseModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TrainDatasetModelRequestBaseModelVersion?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TrainDatasetModelRequestBaseModelVersion? 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::Ideogram.TrainDatasetModelRequestBaseModelVersionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs index 7930d8d..a21e406 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs @@ -89,10 +89,6 @@ namespace Ideogram typeof(global::Ideogram.JsonConverters.DatasetAssetFailureReasonNullableJsonConverter), - typeof(global::Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionJsonConverter), - - typeof(global::Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionNullableJsonConverter), - typeof(global::Ideogram.JsonConverters.ModelStatusJsonConverter), typeof(global::Ideogram.JsonConverters.ModelStatusNullableJsonConverter), @@ -345,8 +341,6 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UploadDatasetAssetsRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelRequestBaseModelVersion), TypeInfoPropertyName = "TrainDatasetModelRequestBaseModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListModelsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CustomModel))] @@ -354,7 +348,10 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRun))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRunStatus), TypeInfoPropertyName = "TrainingRunStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3AdvancedRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetName))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName), TypeInfoPropertyName = "ColorPalettePresetName2")] diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs index 27fdbca..4f481c2 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs @@ -744,87 +744,91 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Ideogram.TrainDatasetModelRequestBaseModelVersion? Type179 { get; set; } + public global::Ideogram.ListModelsResponse? Type179 { get; set; } /// /// /// - public double? Type180 { get; set; } + public global::System.Collections.Generic.IList? Type180 { get; set; } /// /// /// - public global::Ideogram.ListModelsResponse? Type181 { get; set; } + public global::Ideogram.CustomModel? Type181 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type182 { get; set; } + public global::Ideogram.ModelStatus? Type182 { get; set; } /// /// /// - public global::Ideogram.CustomModel? Type183 { get; set; } + public global::System.Collections.Generic.IList? Type183 { get; set; } /// /// /// - public global::Ideogram.ModelStatus? Type184 { get; set; } + public global::Ideogram.TrainingRun? Type184 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type185 { get; set; } + public global::Ideogram.TrainingRunStatus? Type185 { get; set; } /// /// /// - public global::Ideogram.TrainingRun? Type186 { get; set; } + public double? Type186 { get; set; } /// /// /// - public global::Ideogram.TrainingRunStatus? Type187 { get; set; } + public global::Ideogram.GetModelResponse? Type187 { get; set; } /// /// /// - public global::Ideogram.GetModelResponse? Type188 { get; set; } + public global::Ideogram.TrainModelV3Request? Type188 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteWithPresetName? Type189 { get; set; } + public global::Ideogram.TrainModelV3AdvancedRequest? Type189 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteWithMembers? Type190 { get; set; } + public global::Ideogram.ColorPaletteWithPresetName? Type190 { get; set; } /// /// /// - public global::Ideogram.ColorPalettePresetName? Type191 { get; set; } + public global::Ideogram.ColorPaletteWithMembers? Type191 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type192 { get; set; } + public global::Ideogram.ColorPalettePresetName? Type192 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteMember? Type193 { get; set; } + public global::System.Collections.Generic.IList? Type193 { get; set; } /// /// /// - public global::Ideogram.AssetType? Type194 { get; set; } + public global::Ideogram.ColorPaletteMember? Type194 { get; set; } /// /// /// - public global::Ideogram.PostInternalTesting200Response? Type195 { get; set; } + public global::Ideogram.AssetType? Type195 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type196 { get; set; } + public global::Ideogram.PostInternalTesting200Response? Type196 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type197 { get; set; } + public global::System.Collections.Generic.IList? Type197 { get; set; } /// /// /// - public global::Ideogram.ListCustomModelsScope? Type198 { get; set; } + public global::System.Collections.Generic.IList? Type198 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type199 { get; set; } + public global::Ideogram.ListCustomModelsScope? Type199 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type200 { get; set; } /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs index d88e2b0..feda376 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs @@ -5,7 +5,7 @@ namespace Ideogram { /// /// Detailed view of a dataset, including its files.
- /// Example: {"file_count":0,"files":[{"file_name":"file_name","file_size_bytes":6},{"file_name":"file_name","file_size_bytes":6}],"dataset":{"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}},"custom_model_id":"custom_model_id"} + /// Example: {"file_count":0,"custom_model_ids":["custom_model_ids","custom_model_ids"],"files":[{"file_name":"file_name","file_size_bytes":6},{"file_name":"file_name","file_size_bytes":6}],"dataset":{"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}}} ///
public sealed partial class GetDatasetResponse { @@ -34,10 +34,12 @@ public sealed partial class GetDatasetResponse public required global::System.Collections.Generic.IList Files { get; set; } /// - /// ID of the custom model trained from this dataset, if one exists. Null if no model has been trained yet. + /// IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.
+ /// Default Value: [] ///
- [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_id")] - public string? CustomModelId { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_ids")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList CustomModelIds { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -59,8 +61,9 @@ public sealed partial class GetDatasetResponse /// List of files in the dataset.
/// Default Value: [] /// - /// - /// ID of the custom model trained from this dataset, if one exists. Null if no model has been trained yet. + /// + /// IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.
+ /// Default Value: [] /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -69,12 +72,12 @@ public GetDatasetResponse( global::Ideogram.Dataset dataset, int fileCount, global::System.Collections.Generic.IList files, - string? customModelId) + global::System.Collections.Generic.IList customModelIds) { this.Dataset = dataset ?? throw new global::System.ArgumentNullException(nameof(dataset)); this.FileCount = fileCount; this.Files = files ?? throw new global::System.ArgumentNullException(nameof(files)); - this.CustomModelId = customModelId; + this.CustomModelIds = customModelIds ?? throw new global::System.ArgumentNullException(nameof(customModelIds)); } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs index 244aa36..5f40cba 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs @@ -4,7 +4,8 @@ namespace Ideogram { /// - /// Example: {"model_name":"my-custom-model","lora_rank":64,"num_chips":32,"ema":0.999,"base_model_version":"V_3_1","training_steps":1000,"learning_rate":0.0001} + /// Custom Model training request.
+ /// Example: {"model_name":"my-custom-model"} ///
public sealed partial class TrainDatasetModelRequest { @@ -17,56 +18,6 @@ public sealed partial class TrainDatasetModelRequest [global::System.Text.Json.Serialization.JsonRequired] public required string ModelName { get; set; } - /// - /// Number of training steps. Must be between 100 and 20000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - ///
- /// 1000 - [global::System.Text.Json.Serialization.JsonPropertyName("training_steps")] - public int? TrainingSteps { get; set; } - - /// - /// LoRA rank for model training. Must be one of 64, 128, or 256. Defaults to 128. Note: lora_rank 256 requires num_chips >= 64.
- /// Example: 64 - ///
- /// 64 - [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] - public int? LoraRank { get; set; } - - /// - /// Number of TPU chips to use. Allowed values depend on the base_model_version: V_3_1 supports 16, 32, or 64, V_4_0 supports 128.
- /// Example: 32 - ///
- /// 32 - [global::System.Text.Json.Serialization.JsonPropertyName("num_chips")] - public int? NumChips { get; set; } - - /// - /// Base model version to train on. Defaults to V_3_1.
- /// Default Value: V_3_1
- /// Example: V_3_1 - ///
- /// V_3_1 - [global::System.Text.Json.Serialization.JsonPropertyName("base_model_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TrainDatasetModelRequestBaseModelVersionJsonConverter))] - public global::Ideogram.TrainDatasetModelRequestBaseModelVersion? BaseModelVersion { get; set; } - - /// - /// Exponential moving average decay rate. Must be greater than 0.
- /// Example: 0.999F - ///
- /// 0.999F - [global::System.Text.Json.Serialization.JsonPropertyName("ema")] - public double? Ema { get; set; } - - /// - /// Learning rate for the optimizer. Must be greater than 0.
- /// Example: 0.0001F - ///
- /// 0.0001F - [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public double? LearningRate { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -80,50 +31,13 @@ public sealed partial class TrainDatasetModelRequest /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
/// Example: my-custom-model /// - /// - /// Number of training steps. Must be between 100 and 20000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64, 128, or 256. Defaults to 128. Note: lora_rank 256 requires num_chips >= 64.
- /// Example: 64 - /// - /// - /// Number of TPU chips to use. Allowed values depend on the base_model_version: V_3_1 supports 16, 32, or 64, V_4_0 supports 128.
- /// Example: 32 - /// - /// - /// Base model version to train on. Defaults to V_3_1.
- /// Default Value: V_3_1
- /// Example: V_3_1 - /// - /// - /// Exponential moving average decay rate. Must be greater than 0.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0.
- /// Example: 0.0001F - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public TrainDatasetModelRequest( - string modelName, - int? trainingSteps, - int? loraRank, - int? numChips, - global::Ideogram.TrainDatasetModelRequestBaseModelVersion? baseModelVersion, - double? ema, - double? learningRate) + string modelName) { this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - this.TrainingSteps = trainingSteps; - this.LoraRank = loraRank; - this.NumChips = numChips; - this.BaseModelVersion = baseModelVersion; - this.Ema = ema; - this.LearningRate = learningRate; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequestBaseModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequestBaseModelVersion.g.cs deleted file mode 100644 index e8f406c..0000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequestBaseModelVersion.g.cs +++ /dev/null @@ -1,53 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Base model version to train on. Defaults to V_3_1.
- /// Default Value: V_3_1
- /// Example: V_3_1 - ///
- public enum TrainDatasetModelRequestBaseModelVersion - { - /// - /// - /// - V31, - /// - /// - /// - V40, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TrainDatasetModelRequestBaseModelVersionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TrainDatasetModelRequestBaseModelVersion value) - { - return value switch - { - TrainDatasetModelRequestBaseModelVersion.V31 => "V_3_1", - TrainDatasetModelRequestBaseModelVersion.V40 => "V_4_0", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TrainDatasetModelRequestBaseModelVersion? ToEnum(string value) - { - return value switch - { - "V_3_1" => TrainDatasetModelRequestBaseModelVersion.V31, - "V_4_0" => TrainDatasetModelRequestBaseModelVersion.V40, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs new file mode 100644 index 0000000..c384ff2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class TrainModelV3AdvancedRequest + { + /// + /// 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 provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.TrainModelV3AdvancedRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.TrainModelV3AdvancedRequest), + jsonSerializerContext) as global::Ideogram.TrainModelV3AdvancedRequest; + } + + /// + /// 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::Ideogram.TrainModelV3AdvancedRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::Ideogram.TrainModelV3AdvancedRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV3AdvancedRequest; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs new file mode 100644 index 0000000..1b5efc2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Advanced training request for a custom Ideogram v3 model. Hyperparameters are optional and fall back to defaults when omitted.
+ /// Example: {"model_name":"my-custom-model","lora_rank":64,"dataset_id":"abc123","ema":0.999,"training_steps":1000,"learning_rate":0.0001} + ///
+ public sealed partial class TrainModelV3AdvancedRequest + { + /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + ///
+ /// abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DatasetId { get; set; } + + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + ///
+ /// my-custom-model + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { get; set; } + + /// + /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
+ /// Example: 1000 + ///
+ /// 1000 + [global::System.Text.Json.Serialization.JsonPropertyName("training_steps")] + public int? TrainingSteps { get; set; } + + /// + /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
+ /// Example: 64 + ///
+ /// 64 + [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] + public int? LoraRank { get; set; } + + /// + /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
+ /// Example: 0.999F + ///
+ /// 0.999F + [global::System.Text.Json.Serialization.JsonPropertyName("ema")] + public double? Ema { get; set; } + + /// + /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
+ /// Example: 0.0001F + ///
+ /// 0.0001F + [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] + public double? LearningRate { 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 dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// + /// + /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
+ /// Example: 1000 + /// + /// + /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
+ /// Example: 64 + /// + /// + /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
+ /// Example: 0.999F + /// + /// + /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
+ /// Example: 0.0001F + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public TrainModelV3AdvancedRequest( + string datasetId, + string modelName, + int? trainingSteps, + int? loraRank, + double? ema, + double? learningRate) + { + this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + this.TrainingSteps = trainingSteps; + this.LoraRank = loraRank; + this.Ema = ema; + this.LearningRate = learningRate; + } + + /// + /// Initializes a new instance of the class. + /// + public TrainModelV3AdvancedRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs new file mode 100644 index 0000000..673d926 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class TrainModelV3Request + { + /// + /// 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 provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.TrainModelV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.TrainModelV3Request), + jsonSerializerContext) as global::Ideogram.TrainModelV3Request; + } + + /// + /// 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::Ideogram.TrainModelV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::Ideogram.TrainModelV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV3Request; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs new file mode 100644 index 0000000..db2f371 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Training request for a custom Ideogram v3 model using default hyperparameters.
+ /// Example: {"model_name":"my-custom-model","dataset_id":"abc123"} + ///
+ public sealed partial class TrainModelV3Request + { + /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + ///
+ /// abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DatasetId { get; set; } + + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + ///
+ /// my-custom-model + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { 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 dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public TrainModelV3Request( + string datasetId, + string modelName) + { + this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + } + + /// + /// Initializes a new instance of the class. + /// + public TrainModelV3Request() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs new file mode 100644 index 0000000..c039b63 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs @@ -0,0 +1,522 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ModelsClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_TrainModelV3SecurityRequirement0, + }; + partial void PrepareTrainModelV3Arguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.TrainModelV3Request request); + partial void PrepareTrainModelV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.TrainModelV3Request request); + partial void ProcessTrainModelV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTrainModelV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Train a custom Ideogram v3 model
+ /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainModelV3Async( + + global::Ideogram.TrainModelV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTrainModelV3Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TrainModelV3SecurityRequirements, + operationName: "TrainModelV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v1/ideogram-v3/train-model", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.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::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareTrainModelV3Request( + 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::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3", + methodName: "TrainModelV3Async", + pathTemplate: "\"/v1/ideogram-v3/train-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3", + methodName: "TrainModelV3Async", + pathTemplate: "\"/v1/ideogram-v3/train-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3", + methodName: "TrainModelV3Async", + pathTemplate: "\"/v1/ideogram-v3/train-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessTrainModelV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3", + methodName: "TrainModelV3Async", + pathTemplate: "\"/v1/ideogram-v3/train-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3", + methodName: "TrainModelV3Async", + pathTemplate: "\"/v1/ideogram-v3/train-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_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); + ProcessTrainModelV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Train a custom Ideogram v3 model
+ /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. + ///
+ /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainModelV3Async( + string datasetId, + string modelName, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.TrainModelV3Request + { + DatasetId = datasetId, + ModelName = modelName, + }; + + return await TrainModelV3Async( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs new file mode 100644 index 0000000..109e95e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs @@ -0,0 +1,546 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ModelsClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV3AdvancedSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV3AdvancedSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_TrainModelV3AdvancedSecurityRequirement0, + }; + partial void PrepareTrainModelV3AdvancedArguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.TrainModelV3AdvancedRequest request); + partial void PrepareTrainModelV3AdvancedRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.TrainModelV3AdvancedRequest request); + partial void ProcessTrainModelV3AdvancedResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTrainModelV3AdvancedResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Train a custom Ideogram v3 model with advanced hyperparameters
+ /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( + + global::Ideogram.TrainModelV3AdvancedRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTrainModelV3AdvancedArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TrainModelV3AdvancedSecurityRequirements, + operationName: "TrainModelV3AdvancedAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v1/ideogram-v3/train-model-advanced", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.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::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareTrainModelV3AdvancedRequest( + 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::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3Advanced", + methodName: "TrainModelV3AdvancedAsync", + pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3Advanced", + methodName: "TrainModelV3AdvancedAsync", + pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3Advanced", + methodName: "TrainModelV3AdvancedAsync", + pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessTrainModelV3AdvancedResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3Advanced", + methodName: "TrainModelV3AdvancedAsync", + pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TrainModelV3Advanced", + methodName: "TrainModelV3AdvancedAsync", + pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_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); + ProcessTrainModelV3AdvancedResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Train a custom Ideogram v3 model with advanced hyperparameters
+ /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. + ///
+ /// + /// ID of the dataset to train the model from.
+ /// Example: abc123 + /// + /// + /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
+ /// Example: my-custom-model + /// + /// + /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
+ /// Example: 1000 + /// + /// + /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
+ /// Example: 64 + /// + /// + /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
+ /// Example: 0.999F + /// + /// + /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
+ /// Example: 0.0001F + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( + string datasetId, + string modelName, + int? trainingSteps = default, + int? loraRank = default, + double? ema = default, + double? learningRate = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.TrainModelV3AdvancedRequest + { + DatasetId = datasetId, + ModelName = modelName, + TrainingSteps = trainingSteps, + LoraRank = loraRank, + Ema = ema, + LearningRate = learningRate, + }; + + return await TrainModelV3AdvancedAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/autosdk.generated-examples.json b/src/libs/Ideogram/Generated/autosdk.generated-examples.json index c764fa9..0f7e3c6 100644 --- a/src/libs/Ideogram/Generated/autosdk.generated-examples.json +++ b/src/libs/Ideogram/Generated/autosdk.generated-examples.json @@ -61,7 +61,7 @@ "Slug": "train-dataset-model", "Description": "Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.", "Language": "http", - "Code": "### Train a model from a dataset\n# @name train_dataset_model\nPOST {{host}}/datasets/{{dataset_id}}/train_model\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model_name\u0022: \u0022my-custom-model\u0022,\n \u0022lora_rank\u0022: 64,\n \u0022num_chips\u0022: 32,\n \u0022ema\u0022: 0.999,\n \u0022base_model_version\u0022: \u0022V_3_1\u0022,\n \u0022training_steps\u0022: 1000,\n \u0022learning_rate\u0022: 0.0001\n}\n\n## Responses\n# 200\n# Description: Training started successfully\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 404\n# Description: Dataset not found", + "Code": "### Train a model from a dataset\n# @name train_dataset_model\nPOST {{host}}/datasets/{{dataset_id}}/train_model\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model_name\u0022: \u0022my-custom-model\u0022\n}\n\n## Responses\n# 200\n# Description: Training started successfully\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 404\n# Description: Dataset not found", "Format": "http", "OperationId": "train_dataset_model", "Setup": null @@ -552,6 +552,28 @@ }, { "Order": 51, + "Title": "Train a custom Ideogram v3 model", + "Slug": "train-model-v3", + "Description": "Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.", + "Language": "csharp", + "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV3Request\u003E(\n @\u0022{\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV3Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", + "Format": "sdk", + "OperationId": "train_model_v3", + "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 52, + "Title": "Train a custom Ideogram v3 model with advanced hyperparameters", + "Slug": "train-model-v3-advanced", + "Description": "Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.", + "Language": "csharp", + "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV3AdvancedRequest\u003E(\n @\u0022{\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022lora_rank\u0022\u0022: 64,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022,\n \u0022\u0022ema\u0022\u0022: 0.999,\n \u0022\u0022training_steps\u0022\u0022: 1000,\n \u0022\u0022learning_rate\u0022\u0022: 0.0001\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV3AdvancedAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", + "Format": "sdk", + "OperationId": "train_model_v3_advanced", + "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 53, "Title": "Generate Magic Prompt", "Slug": "post-magic-prompt", "Description": "Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally.", @@ -562,7 +584,7 @@ "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 52, + "Order": 54, "Title": "Describe", "Slug": "post-describe", "Description": "Describe an image.\n\nSupported image formats include JPEG, PNG, and WebP.", diff --git a/src/libs/Ideogram/openapi.json b/src/libs/Ideogram/openapi.json index 67864cf..788fd60 100644 --- a/src/libs/Ideogram/openapi.json +++ b/src/libs/Ideogram/openapi.json @@ -3248,6 +3248,94 @@ "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" } }, + "/v1/ideogram-v3/train-model": { + "post": { + "description": "Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.\n", + "operationId": "train_model_v3", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainModelV3Request" + } + } + }, + "description": "Training configuration", + "required": true, + "x-body-name": "train_model_v3_request" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainDatasetModelResponse" + } + } + }, + "description": "Training started successfully" + }, + "400": { + "description": "Bad request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Dataset not found" + } + }, + "summary": "Train a custom Ideogram v3 model", + "tags": [ + "models" + ], + "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" + } + }, + "/v1/ideogram-v3/train-model-advanced": { + "post": { + "description": "Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.\n", + "operationId": "train_model_v3_advanced", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainModelV3AdvancedRequest" + } + } + }, + "description": "Advanced training configuration", + "required": true, + "x-body-name": "train_model_v3_advanced_request" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainDatasetModelResponse" + } + } + }, + "description": "Training started successfully" + }, + "400": { + "description": "Bad request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Dataset not found" + } + }, + "summary": "Train a custom Ideogram v3 model with advanced hyperparameters", + "tags": [ + "models" + ], + "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" + } + }, "/v1/ideogram-v3/try-on": { "post": { "description": "Performs virtual clothing try-on by automatically segmenting the clothing in the provided image\nand replacing it based on the prompt. The user provides an image and an optional prompt describing\nthe desired clothing change (e.g., \"change his shirt to a pink shirt\").\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", @@ -8436,6 +8524,10 @@ "description": "Detailed view of a dataset, including its files.", "example": { "file_count": 0, + "custom_model_ids": [ + "custom_model_ids", + "custom_model_ids" + ], "files": [ { "file_name": "file_name", @@ -8455,8 +8547,7 @@ "asset_type": "RESPONSE", "asset_id": "7uS_VESkRI6O3-sVgHQp_A" } - }, - "custom_model_id": "custom_model_id" + } }, "properties": { "dataset": { @@ -8476,14 +8567,18 @@ "title": "files", "type": "array" }, - "custom_model_id": { - "description": "ID of the custom model trained from this dataset, if one exists. Null if no model has been trained yet.\n", - "nullable": true, - "title": "custom_model_id", - "type": "string" + "custom_model_ids": { + "default": [], + "description": "IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.\n", + "items": { + "type": "string" + }, + "title": "custom_model_ids", + "type": "array" } }, "required": [ + "custom_model_ids", "dataset", "file_count", "files" @@ -8708,14 +8803,9 @@ "type": "object" }, "TrainDatasetModelRequest": { + "description": "Custom Model training request.", "example": { - "model_name": "my-custom-model", - "lora_rank": 64, - "num_chips": 32, - "ema": 0.999, - "base_model_version": "V_3_1", - "training_steps": 1000, - "learning_rate": 0.0001 + "model_name": "my-custom-model" }, "properties": { "model_name": { @@ -8723,47 +8813,6 @@ "example": "my-custom-model", "title": "model_name", "type": "string" - }, - "training_steps": { - "description": "Number of training steps. Must be between 100 and 20000 and a multiple of 100. Defaults to 1000.\n", - "example": 1000, - "title": "training_steps", - "type": "integer" - }, - "lora_rank": { - "description": "LoRA rank for model training. Must be one of 64, 128, or 256. Defaults to 128. Note: lora_rank 256 requires num_chips >= 64.\n", - "example": 64, - "title": "lora_rank", - "type": "integer" - }, - "num_chips": { - "description": "Number of TPU chips to use. Allowed values depend on the base_model_version: V_3_1 supports 16, 32, or 64, V_4_0 supports 128.\n", - "example": 32, - "title": "num_chips", - "type": "integer" - }, - "base_model_version": { - "default": "V_3_1", - "description": "Base model version to train on. Defaults to V_3_1.\n", - "enum": [ - "V_3_1", - "V_4_0" - ], - "example": "V_3_1", - "title": "base_model_version", - "type": "string" - }, - "ema": { - "description": "Exponential moving average decay rate. Must be greater than 0.\n", - "example": 0.999, - "title": "ema", - "type": "number" - }, - "learning_rate": { - "description": "Learning rate for the optimizer. Must be greater than 0.\n", - "example": 0.0001, - "title": "learning_rate", - "type": "number" } }, "required": [ @@ -9120,6 +9169,88 @@ "title": "GetModelResponse", "type": "object" }, + "TrainModelV3Request": { + "description": "Training request for a custom Ideogram v3 model using default hyperparameters.\n", + "example": { + "model_name": "my-custom-model", + "dataset_id": "abc123" + }, + "properties": { + "dataset_id": { + "description": "ID of the dataset to train the model from.", + "example": "abc123", + "title": "dataset_id", + "type": "string" + }, + "model_name": { + "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", + "example": "my-custom-model", + "title": "model_name", + "type": "string" + } + }, + "required": [ + "dataset_id", + "model_name" + ], + "title": "TrainModelV3Request", + "type": "object" + }, + "TrainModelV3AdvancedRequest": { + "description": "Advanced training request for a custom Ideogram v3 model. Hyperparameters are optional and fall back to defaults when omitted.\n", + "example": { + "model_name": "my-custom-model", + "lora_rank": 64, + "dataset_id": "abc123", + "ema": 0.999, + "training_steps": 1000, + "learning_rate": 0.0001 + }, + "properties": { + "dataset_id": { + "description": "ID of the dataset to train the model from.", + "example": "abc123", + "title": "dataset_id", + "type": "string" + }, + "model_name": { + "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", + "example": "my-custom-model", + "title": "model_name", + "type": "string" + }, + "training_steps": { + "description": "Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.\n", + "example": 1000, + "title": "training_steps", + "type": "integer" + }, + "lora_rank": { + "description": "LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.\n", + "example": 64, + "title": "lora_rank", + "type": "integer" + }, + "ema": { + "description": "Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.\n", + "example": 0.999, + "title": "ema", + "type": "number" + }, + "learning_rate": { + "description": "Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.\n", + "example": 0.0001, + "title": "learning_rate", + "type": "number" + } + }, + "required": [ + "dataset_id", + "model_name" + ], + "title": "TrainModelV3AdvancedRequest", + "type": "object" + }, "MagicPromptOption": { "description": "Determine if MagicPrompt should be used in generating the request or not.", "enum": [